Accelerated AES Block CipherCryptography Hardware Acceleration Plugins

Detailed Description

Accelerated AES block cipher using the AES, CRYPTO or SE peripheral.

Data Structures

struct  mbedtls_aes_context
 AES context structure.
 

Functions

void mbedtls_aes_init (mbedtls_aes_context *ctx)
 Initialize AES context.
 
void mbedtls_aes_free (mbedtls_aes_context *ctx)
 Clear AES context.
 
int mbedtls_aes_setkey_enc (mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
 AES key schedule (encryption)
 
int mbedtls_aes_setkey_dec (mbedtls_aes_context *ctx, const unsigned char *key, unsigned int keybits)
 AES key schedule (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_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_ALT)
 
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_ALT)
 

Function Documentation

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.

Parameters
ctxAES context
modeMBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
input16-byte input block
output16-byte output block
Returns
0 if successful
void mbedtls_aes_free ( mbedtls_aes_context ctx)

Clear AES context.

Parameters
ctxAES context to be cleared
void mbedtls_aes_init ( mbedtls_aes_context ctx)

Initialize AES context.

Parameters
ctxAES context to be initialized
int mbedtls_aes_setkey_dec ( mbedtls_aes_context ctx,
const unsigned char *  key,
unsigned int  keybits 
)

AES key schedule (decryption)

Parameters
ctxAES context to be initialized
keydecryption key
keybitsmust be 128, 192 or 256
Returns
0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
int mbedtls_aes_setkey_enc ( mbedtls_aes_context ctx,
const unsigned char *  key,
unsigned int  keybits 
)

AES key schedule (encryption)

Parameters
ctxAES context to be initialized
keyencryption key
keybitsmust be 128, 192 or 256
Returns
0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
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_ALT)

Parameters
ctxAES context
inputCiphertext block
outputOutput (plaintext) block
Returns
0 if successful
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_ALT)

Parameters
ctxAES context
inputPlaintext block
outputOutput (ciphertext) block
Returns
0 if successful