27 #ifndef POLARSSL_AES_H
28 #define POLARSSL_AES_H
30 #if !defined(POLARSSL_CONFIG_FILE)
33 #include POLARSSL_CONFIG_FILE
38 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
40 typedef UINT32 uint32_t;
49 #define POLARSSL_ERR_AES_INVALID_KEY_LENGTH -0x0020
50 #define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH -0x0022
52 #if !defined(POLARSSL_AES_ALT)
100 unsigned int keysize );
112 unsigned int keysize );
126 const unsigned char input[16],
127 unsigned char output[16] );
129 #if defined(POLARSSL_CIPHER_MODE_CBC)
147 unsigned char iv[16],
148 const unsigned char *input,
149 unsigned char *output );
152 #if defined(POLARSSL_CIPHER_MODE_CFB)
174 unsigned char iv[16],
175 const unsigned char *input,
176 unsigned char *output );
197 unsigned char iv[16],
198 const unsigned char *input,
199 unsigned char *output );
202 #if defined(POLARSSL_CIPHER_MODE_CTR)
228 unsigned char nonce_counter[16],
229 unsigned char stream_block[16],
230 const unsigned char *input,
231 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.