97#ifndef __TC_CMAC_MODE_H__
98#define __TC_CMAC_MODE_H__
109#define TC_CMAC_PADDING 0x80
112typedef struct tc_cmac_struct {
114 uint8_t iv[TC_AES_BLOCK_SIZE];
116 uint8_t K1[TC_AES_BLOCK_SIZE];
118 uint8_t K2[TC_AES_BLOCK_SIZE];
120 uint8_t leftover[TC_AES_BLOCK_SIZE];
124 unsigned int leftover_offset;
126 TCAesKeySched_t sched;
143 TCAesKeySched_t sched);
176int tc_cmac_update(TCCmacState_t s,
const uint8_t *data,
size_t dlen);
– Interface to an AES-128 implementation.
int tc_cmac_final(uint8_t *tag, TCCmacState_t s)
Generates the tag from the CMAC state.
Definition cmac_mode.c:222
int tc_cmac_init(TCCmacState_t s)
Initializes a new CMAC computation.
Definition cmac_mode.c:137
int tc_cmac_erase(TCCmacState_t s)
Erases the CMAC state.
Definition cmac_mode.c:125
int tc_cmac_setup(TCCmacState_t s, const uint8_t *key, TCAesKeySched_t sched)
Configures the CMAC state to use the given AES key.
Definition cmac_mode.c:97
int tc_cmac_update(TCCmacState_t s, const uint8_t *data, size_t dlen)
Incrementally computes CMAC over the next data segment.
Definition cmac_mode.c:157