26 #if !defined(MBEDTLS_CONFIG_FILE)
29 #include MBEDTLS_CONFIG_FILE
36 #define MBEDTLS_AES_ENCRYPT 1
37 #define MBEDTLS_AES_DECRYPT 0
39 #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020
40 #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022
42 #if !defined(MBEDTLS_AES_ALT)
71 void mbedtls_aes_init( mbedtls_aes_context *ctx );
78 void mbedtls_aes_free( mbedtls_aes_context *ctx );
89 int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx,
const unsigned char *key,
90 unsigned int keybits );
101 int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx,
const unsigned char *key,
102 unsigned int keybits );
114 int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx,
116 const unsigned char input[16],
117 unsigned char output[16] );
119 #if defined(MBEDTLS_CIPHER_MODE_CBC)
142 int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx,
145 unsigned char iv[16],
146 const unsigned char *input,
147 unsigned char *output );
150 #if defined(MBEDTLS_CIPHER_MODE_CFB)
176 int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx,
180 unsigned char iv[16],
181 const unsigned char *input,
182 unsigned char *output );
208 int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx,
211 unsigned char iv[16],
212 const unsigned char *input,
213 unsigned char *output );
216 #if defined(MBEDTLS_CIPHER_MODE_CTR)
239 int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
242 unsigned char nonce_counter[16],
243 unsigned char stream_block[16],
244 const unsigned char *input,
245 unsigned char *output );
257 void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
258 const unsigned char input[16],
259 unsigned char output[16] );
270 void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
271 const unsigned char input[16],
272 unsigned char output[16] );
int mbedtls_aes_self_test(int verbose)
Checkup routine.
Configuration options (set of defines)