SEcube open-source SDK
AES functions

AES functions

int32_t B5_Aes256_Init (B5_tAesCtx *ctx, const uint8_t *Key, int16_t keySize, uint8_t aesMode)
 Initialize the AES context. More...
 
int32_t B5_Aes256_SetIV (B5_tAesCtx *ctx, const uint8_t *IV)
 Set the IV for the current AES context. More...
 
int32_t B5_Aes256_Update (B5_tAesCtx *ctx, uint8_t *encData, uint8_t *clrData, int16_t nBlk)
 Encrypt/Decrypt data based on the status of current AES context. More...
 
int32_t B5_Aes256_Finit (B5_tAesCtx *ctx)
 De-initialize the current AES context. More...
 

Detailed Description

Function Documentation

◆ B5_Aes256_Finit()

int32_t B5_Aes256_Finit ( B5_tAesCtx *  ctx)

De-initialize the current AES context.

Parameters
ctxPointer to the AES context to de-initialize.
Returns
See AES return values .

◆ B5_Aes256_Init()

int32_t B5_Aes256_Init ( B5_tAesCtx *  ctx,
const uint8_t *  Key,
int16_t  keySize,
uint8_t  aesMode 
)

Initialize the AES context.

Parameters
ctxPointer to the AES data structure to be initialized.
KeyPointer to the Key that must be used for encryption/decryption.
keySizeKey size. See AES Key, IV, Block Sizes for supported sizes.
aesModeAES mode. See AES modes for supported modes.
Returns
See AES return values .

◆ B5_Aes256_SetIV()

int32_t B5_Aes256_SetIV ( B5_tAesCtx *  ctx,
const uint8_t *  IV 
)

Set the IV for the current AES context.

Parameters
ctxPointer to the AES data structure to be initialized.
IVPointer to the IV.
Returns
See AES return values .

◆ B5_Aes256_Update()

int32_t B5_Aes256_Update ( B5_tAesCtx *  ctx,
uint8_t *  encData,
uint8_t *  clrData,
int16_t  nBlk 
)

Encrypt/Decrypt data based on the status of current AES context.

Parameters
ctxPointer to the current AES context.
encDataEncrypted data.
clrDataClear data.
nBlkNumber of AES blocks to process.
Returns
See AES return values .