62 #if !defined(MBEDTLS_CONFIG_FILE)
65 #include MBEDTLS_CONFIG_FILE
72 #define MBEDTLS_AES_ENCRYPT 1
73 #define MBEDTLS_AES_DECRYPT 0
76 #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020
77 #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022
80 #define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023
81 #define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025
83 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
84 !defined(inline) && !defined(__cplusplus)
85 #define inline __inline
88 #if !defined(MBEDTLS_AES_ALT)
145 unsigned int keybits );
160 unsigned int keybits );
184 const unsigned char input[16],
185 unsigned char output[16] );
187 #if defined(MBEDTLS_CIPHER_MODE_CBC)
227 unsigned char iv[16],
228 const unsigned char *input,
229 unsigned char *output );
232 #if defined(MBEDTLS_CIPHER_MODE_CFB)
271 unsigned char iv[16],
272 const unsigned char *input,
273 unsigned char *output );
310 unsigned char iv[16],
311 const unsigned char *input,
312 unsigned char *output );
315 #if defined(MBEDTLS_CIPHER_MODE_CTR)
347 unsigned char nonce_counter[16],
348 unsigned char stream_block[16],
349 const unsigned char *input,
350 unsigned char *output );
365 const unsigned char input[16],
366 unsigned char output[16] );
380 const unsigned char input[16],
381 unsigned char output[16] );
383 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
384 #if defined(MBEDTLS_DEPRECATED_WARNING)
385 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
387 #define MBEDTLS_DEPRECATED
400 const unsigned char input[16],
401 unsigned char output[16] );
414 const unsigned char input[16],
415 unsigned char output[16] );
417 #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)
This function initializes the specified 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. This is only exposed to allow overriding it using MBEDTLS_AES...
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)
This function performs an AES-CTR encryption or decryption operation.
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
This function performs an AES single-block encryption or decryption operation.
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)
This function performs an AES-CBC encryption or decryption operation on full blocks.
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the decryption key.
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)
This function performs an AES-CFB128 encryption or decryption operation.
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)
This function performs an AES-CFB8 encryption or decryption operation.
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the encryption key.
void mbedtls_aes_free(mbedtls_aes_context *ctx)
This function releases and clears the specified AES context.
The AES context-type definition.
int mbedtls_internal_aes_decrypt(mbedtls_aes_context *ctx, const unsigned char input[16], unsigned char output[16])
Internal AES block decryption function. This is only exposed to allow overriding it using see MBEDTLS...
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.