44 #if !defined(MBEDTLS_CONFIG_FILE) 47 #include MBEDTLS_CONFIG_FILE 54 #define MBEDTLS_AES_ENCRYPT 1 55 #define MBEDTLS_AES_DECRYPT 0 58 #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020 59 #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022 62 #define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021 65 #define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023 68 #define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025 70 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ 71 !defined(inline) && !defined(__cplusplus) 72 #define inline __inline 79 #if !defined(MBEDTLS_AES_ALT) 101 #if defined(MBEDTLS_CIPHER_MODE_XTS) 105 typedef struct mbedtls_aes_xts_context
111 } mbedtls_aes_xts_context;
137 #if defined(MBEDTLS_CIPHER_MODE_XTS) 146 void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx );
155 void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx );
174 unsigned int keybits );
192 unsigned int keybits );
194 #if defined(MBEDTLS_CIPHER_MODE_XTS) 211 int mbedtls_aes_xts_setkey_enc( mbedtls_aes_xts_context *ctx,
212 const unsigned char *key,
213 unsigned int keybits );
231 int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx,
232 const unsigned char *key,
233 unsigned int keybits );
261 const unsigned char input[16],
262 unsigned char output[16] );
264 #if defined(MBEDTLS_CIPHER_MODE_CBC) 309 unsigned char iv[16],
310 const unsigned char *input,
311 unsigned char *output );
314 #if defined(MBEDTLS_CIPHER_MODE_XTS) 350 int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
353 const unsigned char data_unit[16],
354 const unsigned char *input,
355 unsigned char *output );
358 #if defined(MBEDTLS_CIPHER_MODE_CFB) 402 unsigned char iv[16],
403 const unsigned char *input,
404 unsigned char *output );
445 unsigned char iv[16],
446 const unsigned char *input,
447 unsigned char *output );
450 #if defined(MBEDTLS_CIPHER_MODE_OFB) 499 unsigned char iv[16],
500 const unsigned char *input,
501 unsigned char *output );
505 #if defined(MBEDTLS_CIPHER_MODE_CTR) 585 unsigned char nonce_counter[16],
586 unsigned char stream_block[16],
587 const unsigned char *input,
588 unsigned char *output );
603 const unsigned char input[16],
604 unsigned char output[16] );
618 const unsigned char input[16],
619 unsigned char output[16] );
621 #if !defined(MBEDTLS_DEPRECATED_REMOVED) 622 #if defined(MBEDTLS_DEPRECATED_WARNING) 623 #define MBEDTLS_DEPRECATED __attribute__((deprecated)) 625 #define MBEDTLS_DEPRECATED 638 const unsigned char input[16],
639 unsigned char output[16] );
652 const unsigned char input[16],
653 unsigned char output[16] );
655 #undef MBEDTLS_DEPRECATED uint32_t buf[68]
Definition: aes.h:90
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.
Definition: aes.c:924
int mbedtls_aes_self_test(int verbose)
Checkup routine.
#define MBEDTLS_DEPRECATED
Definition: aes.h:625
Configuration options (set of defines)
void mbedtls_aes_init(mbedtls_aes_context *ctx)
This function initializes the specified AES context.
Definition: aes.c:518
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...
Definition: aes.c:868
int nr
Definition: aes.h:88
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.
Definition: aes.c:1003
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the decryption key.
Definition: aes.c:672
uint32_t * rk
Definition: aes.h:89
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the encryption key.
Definition: aes.c:556
void mbedtls_aes_free(mbedtls_aes_context *ctx)
This function releases and clears the specified AES context.
Definition: aes.c:525
The AES context-type definition.
Definition: aes.h:86
struct mbedtls_aes_context mbedtls_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...
Definition: aes.c:936
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.
Definition: aes.c:992