28 #if !defined(MBEDTLS_CONFIG_FILE)
31 #include MBEDTLS_CONFIG_FILE
38 #define MBEDTLS_AES_ENCRYPT 1
39 #define MBEDTLS_AES_DECRYPT 0
41 #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020
42 #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022
44 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
45 !defined(inline) && !defined(__cplusplus)
46 #define inline __inline
49 #if !defined(MBEDTLS_AES_ALT)
97 unsigned int keybits );
109 unsigned int keybits );
123 const unsigned char input[16],
124 unsigned char output[16] );
126 #if defined(MBEDTLS_CIPHER_MODE_CBC)
152 unsigned char iv[16],
153 const unsigned char *input,
154 unsigned char *output );
157 #if defined(MBEDTLS_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(MBEDTLS_CIPHER_MODE_CTR)
249 unsigned char nonce_counter[16],
250 unsigned char stream_block[16],
251 const unsigned char *input,
252 unsigned char *output );
267 const unsigned char input[16],
268 unsigned char output[16] );
282 const unsigned char input[16],
283 unsigned char output[16] );
285 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
286 #if defined(MBEDTLS_DEPRECATED_WARNING)
287 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
289 #define MBEDTLS_DEPRECATED
302 const unsigned char input[16],
303 unsigned char output[16] );
316 const unsigned char input[16],
317 unsigned char output[16] );
319 #undef MBEDTLS_DEPRECATED
MBEDTLS_DEPRECATED void mbedtls_aes_encrypt(mbedtls_aes_context *ctx, const unsigned char input[16], unsigned char output[16])
Deprecated internal AES block encryption function without return value.
int mbedtls_aes_self_test(int verbose)
Checkup routine.
#define MBEDTLS_DEPRECATED
Configuration options (set of defines)
void mbedtls_aes_init(mbedtls_aes_context *ctx)
Initialize AES context.
int mbedtls_internal_aes_encrypt(mbedtls_aes_context *ctx, const unsigned char input[16], unsigned char output[16])
Internal AES block encryption function (Only exposed to allow overriding it, see MBEDTLS_AES_ENCRYPT_...
int mbedtls_aes_crypt_ctr(mbedtls_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.
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
AES-ECB block encryption/decryption.
int mbedtls_aes_crypt_cbc(mbedtls_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 mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
AES key schedule (decryption)
int mbedtls_aes_crypt_cfb128(mbedtls_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.
int mbedtls_aes_crypt_cfb8(mbedtls_aes_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
AES-CFB8 buffer encryption/decryption.
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
AES key schedule (encryption)
void mbedtls_aes_free(mbedtls_aes_context *ctx)
Clear AES context.
int mbedtls_internal_aes_decrypt(mbedtls_aes_context *ctx, const unsigned char input[16], unsigned char output[16])
Internal AES block decryption function (Only exposed to allow overriding it, see MBEDTLS_AES_DECRYPT_...
MBEDTLS_DEPRECATED void mbedtls_aes_decrypt(mbedtls_aes_context *ctx, const unsigned char input[16], unsigned char output[16])
Deprecated internal AES block decryption function without return value.