23 #define B5_AES256_RES_OK ( 0)
25 #define B5_AES256_RES_INVALID_CONTEXT (-1)
26 #define B5_AES256_RES_CANNOT_ALLOCATE_CONTEXT (-2)
27 #define B5_AES256_RES_INVALID_KEY_SIZE (-3)
28 #define B5_AES256_RES_INVALID_ARGUMENT (-4)
29 #define B5_AES256_RES_INVALID_MODE (-5)
45 #define B5_AES_IV_SIZE 16
46 #define B5_AES_BLK_SIZE 16
55 #define B5_AES256_OFB 1
57 #define B5_AES256_ECB_ENC 2
58 #define B5_AES256_ECB_DEC 3
59 #define B5_AES256_CBC_ENC 4
60 #define B5_AES256_CBC_DEC 5
61 #define B5_AES256_CFB_ENC 6
62 #define B5_AES256_CFB_DEC 7
63 #define B5_AES256_CTR 8
76 uint32_t rk[4*(14 + 1)];
78 uint8_t InitVector[16];
151 #define B5_CMAC_AES_256 32
153 #define B5_CMAC_AES_192 24
154 #define B5_CMAC_AES_128 16
155 #define B5_CMAC_AES_BLK_SIZE 16
164 #define B5_CMAC_AES256_RES_OK ( 0)
166 #define B5_CMAC_AES256_RES_INVALID_CONTEXT (-1)
167 #define B5_CMAC_AES256_RES_CANNOT_ALLOCATE_CONTEXT (-2)
168 #define B5_CMAC_AES256_RES_INVALID_KEY_SIZE (-3)
169 #define B5_CMAC_AES256_RES_INVALID_ARGUMENT (-4)
247 int32_t
B5_CmacAes256_Sign (
const uint8_t *data, int32_t dataLen,
const uint8_t *Key, int16_t keySize, uint8_t *rSignature);
int32_t B5_CmacAes256_Update(B5_tCmacAesCtx *ctx, const uint8_t *data, int32_t dataLen)
Compute the CMAC-AES algorithm on input data depending on the current status of the CMAC-AES context...
Definition: aes256.c:1621
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.
Definition: aes256.c:1268
int32_t B5_CmacAes256_Reset(B5_tCmacAesCtx *ctx)
Reset the current CMAC-AES context.
Definition: aes256.c:1725
int32_t B5_Aes256_SetIV(B5_tAesCtx *ctx, const uint8_t *IV)
Set the IV for the current AES context.
Definition: aes256.c:1245
int32_t B5_CmacAes256_Finit(B5_tCmacAesCtx *ctx, uint8_t *rSignature)
De-initialize the current CMAC-AES context.
Definition: aes256.c:1682
#define B5_AES_BLK_SIZE
Definition: aes256.h:46
int32_t B5_Aes256_Finit(B5_tAesCtx *ctx)
De-initialize the current AES context.
Definition: aes256.c:1455
uint8_t Nr
Definition: aes256.h:77
int32_t B5_CmacAes256_Sign(const uint8_t *data, int32_t dataLen, const uint8_t *Key, int16_t keySize, uint8_t *rSignature)
Compute the signature through the CMAC-AES algorithm.
Definition: aes256.c:1473
int32_t B5_CmacAes256_Init(B5_tCmacAesCtx *ctx, const uint8_t *Key, int16_t keySize)
Initialize the CMAC-AES context.
Definition: aes256.c:1565
int32_t B5_Aes256_Init(B5_tAesCtx *ctx, const uint8_t *Key, int16_t keySize, uint8_t aesMode)
Initialize the AES context.
Definition: aes256.c:1193
uint8_t mode
Definition: aes256.h:79