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(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ 43 !defined(inline) && !defined(__cplusplus) 44 #define inline __inline 47 #if !defined(MBEDTLS_AES_ALT) 95 unsigned int keybits );
107 unsigned int keybits );
121 const unsigned char input[16],
122 unsigned char output[16] );
124 #if defined(MBEDTLS_CIPHER_MODE_CBC) 150 unsigned char iv[16],
151 const unsigned char *input,
152 unsigned char *output );
155 #if defined(MBEDTLS_CIPHER_MODE_CFB) 185 unsigned char iv[16],
186 const unsigned char *input,
187 unsigned char *output );
216 unsigned char iv[16],
217 const unsigned char *input,
218 unsigned char *output );
221 #if defined(MBEDTLS_CIPHER_MODE_CTR) 247 unsigned char nonce_counter[16],
248 unsigned char stream_block[16],
249 const unsigned char *input,
250 unsigned char *output );
265 const unsigned char input[16],
266 unsigned char output[16] );
280 const unsigned char input[16],
281 unsigned char output[16] );
283 #if !defined(MBEDTLS_DEPRECATED_REMOVED) 284 #if defined(MBEDTLS_DEPRECATED_WARNING) 285 #define MBEDTLS_DEPRECATED __attribute__((deprecated)) 287 #define MBEDTLS_DEPRECATED 302 const unsigned char input[16],
303 unsigned char output[16] )
321 const unsigned char input[16],
322 unsigned char output[16] )
327 #undef MBEDTLS_DEPRECATED 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_...
static MBEDTLS_DEPRECATED void mbedtls_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_...
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)
static MBEDTLS_DEPRECATED void mbedtls_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_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_...