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];
110 int32_t
B5_Aes256_Init (B5_tAesCtx *ctx,
const uint8_t *Key, int16_t keySize, uint8_t aesMode);
130 int32_t
B5_Aes256_Update (B5_tAesCtx *ctx, uint8_t *encData, uint8_t *clrData, int16_t nBlk);
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)
208 int32_t
B5_CmacAes256_Init (B5_tCmacAesCtx *ctx,
const uint8_t *Key, int16_t keySize);
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_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.cpp:1268
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.cpp:1621
#define B5_AES256_OFB
Definition: aes256.h:56
#define B5_AES_256
Definition: aes256.h:42
#define B5_AES256_CBC_ENC
Definition: aes256.h:59
#define B5_AES256_CBC_DEC
Definition: aes256.h:60
#define B5_AES256_ECB_DEC
Definition: aes256.h:58
#define B5_AES_128
Definition: aes256.h:44
int32_t B5_CmacAes256_Init(B5_tCmacAesCtx *ctx, const uint8_t *Key, int16_t keySize)
Initialize the CMAC-AES context.
Definition: aes256.cpp:1565
#define B5_AES256_CFB_DEC
Definition: aes256.h:62
int32_t B5_Aes256_SetIV(B5_tAesCtx *ctx, const uint8_t *IV)
Set the IV for the current AES context.
Definition: aes256.cpp:1245
#define B5_AES_IV_SIZE
Definition: aes256.h:45
#define B5_AES256_ECB_ENC
Definition: aes256.h:57
int32_t B5_CmacAes256_Reset(B5_tCmacAesCtx *ctx)
Reset the current CMAC-AES context.
Definition: aes256.cpp:1728
#define B5_AES_192
Definition: aes256.h:43
#define B5_CMAC_AES_128
Definition: aes256.h:154
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.cpp:1473
#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.cpp:1455
#define B5_CMAC_AES_256
Definition: aes256.h:152
int32_t B5_Aes256_Init(B5_tAesCtx *ctx, const uint8_t *Key, int16_t keySize, uint8_t aesMode)
Initialize the AES context.
Definition: aes256.cpp:1193
#define B5_AES256_CTR
Definition: aes256.h:63
#define B5_AES256_CFB_ENC
Definition: aes256.h:61
int32_t B5_CmacAes256_Finit(B5_tCmacAesCtx *ctx, uint8_t *rSignature)
De-initialize the current CMAC-AES context.
Definition: aes256.cpp:1682
#define B5_CMAC_AES_192
Definition: aes256.h:153