24 #ifndef POLARSSL_AES_H
25 #define POLARSSL_AES_H
27 #if !defined(POLARSSL_CONFIG_FILE)
30 #include POLARSSL_CONFIG_FILE
35 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
37 typedef UINT32 uint32_t;
46 #define POLARSSL_ERR_AES_INVALID_KEY_LENGTH -0x0020
47 #define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH -0x0022
49 #if !defined(POLARSSL_AES_ALT)
97 unsigned int keysize );
109 unsigned int keysize );
123 const unsigned char input[16],
124 unsigned char output[16] );
126 #if defined(POLARSSL_CIPHER_MODE_CBC)
152 unsigned char iv[16],
153 const unsigned char *input,
154 unsigned char *output );
157 #if defined(POLARSSL_CIPHER_MODE_CFB)
187 unsigned char iv[16],
188 const unsigned char *input,
189 unsigned char *output );
218 unsigned char iv[16],
219 const unsigned char *input,
220 unsigned char *output );
223 #if defined(POLARSSL_CIPHER_MODE_CTR)
249 unsigned char nonce_counter[16],
250 unsigned char stream_block[16],
251 const unsigned char *input,
252 unsigned char *output );
int aes_crypt_cfb128(aes_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[16], const unsigned char *input, unsigned char *output)
AES-CFB128 buffer encryption/decryption.
Configuration options (set of defines)
int aes_setkey_dec(aes_context *ctx, const unsigned char *key, unsigned int keysize)
AES key schedule (decryption)
int aes_crypt_cbc(aes_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
AES-CBC buffer encryption/decryption Length should be a multiple of the block size (16 bytes) ...
int aes_self_test(int verbose)
Checkup routine.
int aes_crypt_cfb8(aes_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
AES-CFB8 buffer encryption/decryption.
void aes_free(aes_context *ctx)
Clear AES context.
int aes_setkey_enc(aes_context *ctx, const unsigned char *key, unsigned int keysize)
AES key schedule (encryption)
int aes_crypt_ecb(aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
AES-ECB block encryption/decryption.
void aes_init(aes_context *ctx)
Initialize AES context.
int aes_crypt_ctr(aes_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[16], unsigned char stream_block[16], const unsigned char *input, unsigned char *output)
AES-CTR buffer encryption/decryption.