Commit | Line | Data |
---|---|---|
0c1f3509 MG |
1 | #ifndef _CRYPTO_AES_AESNI_H_ |
2 | #define _CRYPTO_AES_AESNI_H_ | |
3 | ||
4 | #include <stddef.h> | |
5 | #include <stdint.h> | |
6 | ||
7 | /** | |
8 | * crypto_aes_key_expand_aesni(key, len): | |
9 | * Expand the ${len}-byte AES key ${key} into a structure which can be passed | |
10 | * to crypto_aes_encrypt_block_aesni. The length must be 16 or 32. This | |
11 | * implementation uses x86 AESNI instructions, and should only be used if | |
12 | * CPUSUPPORT_X86_AESNI is defined and cpusupport_x86_aesni() returns nonzero. | |
13 | */ | |
14 | void * crypto_aes_key_expand_aesni(const uint8_t *, size_t); | |
15 | ||
16 | /** | |
17 | * crypto_aes_encrypt_block_aesni(in, out, key): | |
18 | * Using the expanded AES key ${key}, encrypt the block ${in} and write the | |
19 | * resulting ciphertext to ${out}. This implementation uses x86 AESNI | |
20 | * instructions, and should only be used if CPUSUPPORT_X86_AESNI is defined | |
21 | * and cpusupport_x86_aesni() returns nonzero. | |
22 | */ | |
23 | void crypto_aes_encrypt_block_aesni(const uint8_t *, uint8_t *, const void *); | |
24 | ||
25 | /** | |
26 | * crypto_aes_key_free_aesni(key): | |
27 | * Free the expanded AES key ${key}. | |
28 | */ | |
29 | void crypto_aes_key_free_aesni(void *); | |
30 | ||
31 | #endif /* !_CRYPTO_AES_AESNI_H_ */ |