39#define MBEDTLS_AES_ENCRYPT 1
40#define MBEDTLS_AES_DECRYPT 0
44#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020
46#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022
50#define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021
56#if !defined(MBEDTLS_AES_ALT)
67#if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && !defined(MBEDTLS_PADLOCK_C)
83#if defined(MBEDTLS_CIPHER_MODE_XTS)
87typedef struct mbedtls_aes_xts_context {
92} mbedtls_aes_xts_context;
118#if defined(MBEDTLS_CIPHER_MODE_XTS)
127void mbedtls_aes_xts_init(mbedtls_aes_xts_context *ctx);
136void mbedtls_aes_xts_free(mbedtls_aes_xts_context *ctx);
156 unsigned int keybits);
158#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
176 unsigned int keybits);
179#if defined(MBEDTLS_CIPHER_MODE_XTS)
197int mbedtls_aes_xts_setkey_enc(mbedtls_aes_xts_context *ctx,
198 const unsigned char *key,
199 unsigned int keybits);
218int mbedtls_aes_xts_setkey_dec(mbedtls_aes_xts_context *ctx,
219 const unsigned char *key,
220 unsigned int keybits);
249 const unsigned char input[16],
250 unsigned char output[16]);
252#if defined(MBEDTLS_CIPHER_MODE_CBC)
298 unsigned char iv[16],
299 const unsigned char *
input,
300 unsigned char *output);
303#if defined(MBEDTLS_CIPHER_MODE_XTS)
340int mbedtls_aes_crypt_xts(mbedtls_aes_xts_context *ctx,
343 const unsigned char data_unit[16],
344 const unsigned char *
input,
345 unsigned char *output);
348#if defined(MBEDTLS_CIPHER_MODE_CFB)
393 unsigned char iv[16],
394 const unsigned char *
input,
395 unsigned char *output);
437 unsigned char iv[16],
438 const unsigned char *
input,
439 unsigned char *output);
442#if defined(MBEDTLS_CIPHER_MODE_OFB)
492 unsigned char iv[16],
493 const unsigned char *
input,
494 unsigned char *output);
498#if defined(MBEDTLS_CIPHER_MODE_CTR)
575 unsigned char nonce_counter[16],
576 unsigned char stream_block[16],
577 const unsigned char *
input,
578 unsigned char *output);
594 const unsigned char input[16],
595 unsigned char output[16]);
597#if !defined(MBEDTLS_BLOCK_CIPHER_NO_DECRYPT)
611 const unsigned char input[16],
612 unsigned char output[16]);
615#if defined(MBEDTLS_SELF_TEST)
unsigned int uint32_t
Definition acefiex.h:163
MBEDTLS_CHECK_RETURN_TYPICAL 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.
MBEDTLS_CHECK_RETURN_TYPICAL int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the encryption key.
MBEDTLS_CHECK_RETURN_TYPICAL 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...
void mbedtls_aes_init(mbedtls_aes_context *ctx)
This function initializes the specified AES context.
MBEDTLS_CHECK_RETURN_TYPICAL int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
This function sets the decryption key.
MBEDTLS_CHECK_RETURN_TYPICAL 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...
void mbedtls_aes_free(mbedtls_aes_context *ctx)
This function releases and clears the specified AES context.
int mbedtls_aes_self_test(int verbose)
Build-time configuration info.
Macro wrapper for struct's members.
#define MBEDTLS_PRIVATE(member)
Definition private_access.h:15
The AES context-type definition.
Definition aes.h:63
size_t MBEDTLS_PRIVATE(rk_offset)
uint32_t MBEDTLS_PRIVATE(buf)[68]
struct VirtioInputEvent * input
Definition virtiokbd.c:46