Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/cbc_mac.h
Show All 40 Lines | |||||
# define CCM_CBC_MAX_DIGEST_LEN 16 | # define CCM_CBC_MAX_DIGEST_LEN 16 | ||||
# define CCM_CBC_MIN_DIGEST_LEN 4 | # define CCM_CBC_MIN_DIGEST_LEN 4 | ||||
/* | /* | ||||
* This is the authentication context structure; | * This is the authentication context structure; | ||||
* the encryption one is similar. | * the encryption one is similar. | ||||
*/ | */ | ||||
struct aes_cbc_mac_ctx { | struct aes_cbc_mac_ctx { | ||||
uint64_t authDataLength, authDataCount; | |||||
uint64_t cryptDataLength, cryptDataCount; | |||||
int blockIndex; | |||||
uint8_t staging_block[CCM_CBC_BLOCK_LEN]; | uint8_t staging_block[CCM_CBC_BLOCK_LEN]; | ||||
uint8_t block[CCM_CBC_BLOCK_LEN]; | uint8_t block[CCM_CBC_BLOCK_LEN]; | ||||
const uint8_t *nonce; | int blockIndex; | ||||
int nonceLength; /* This one is in bytes, not bits! */ | int nonceLength; /* This one is in bytes, not bits! */ | ||||
const uint8_t *nonce; | |||||
/* AES state data */ | /* AES state data */ | ||||
int rounds; | int rounds; | ||||
uint32_t keysched[4*(RIJNDAEL_MAXNR+1)]; | uint32_t keysched[4*(RIJNDAEL_MAXNR+1)]; | ||||
}; | }; | ||||
void AES_CBC_MAC_Init(void *); | void AES_CBC_MAC_Init(void *); | ||||
void AES_CBC_MAC_Setkey(void *, const uint8_t *, u_int); | void AES_CBC_MAC_Setkey(void *, const uint8_t *, u_int); | ||||
void AES_CBC_MAC_Reinit(void *, const uint8_t *, u_int); | void AES_CBC_MAC_Reinit(void *, const uint8_t *, u_int); | ||||
int AES_CBC_MAC_Update(void *, const void *, u_int); | int AES_CBC_MAC_Update(void *, const void *, u_int); | ||||
void AES_CBC_MAC_Final(uint8_t *, void *); | void AES_CBC_MAC_Final(uint8_t *, void *); | ||||
#endif /* _CBC_CCM_H */ | #endif /* _CBC_CCM_H */ |