![]() |
ndn-lite
|
Functions | |
int | tc_ccm_config (TCCcmMode_t c, TCAesKeySched_t sched, uint8_t *nonce, unsigned int nlen, unsigned int mlen) |
CCM configuration procedure. More... | |
static void | ccm_cbc_mac (uint8_t *T, const uint8_t *data, unsigned int dlen, unsigned int flag, TCAesKeySched_t sched) |
Variation of CBC-MAC mode used in CCM. More... | |
static int | ccm_ctr_mode (uint8_t *out, unsigned int outlen, const uint8_t *in, unsigned int inlen, uint8_t *ctr, const TCAesKeySched_t sched) |
Variation of CTR mode used in CCM. More... | |
int | tc_ccm_generation_encryption (uint8_t *out, unsigned int olen, const uint8_t *associated_data, unsigned int alen, const uint8_t *payload, unsigned int plen, TCCcmMode_t c) |
CCM tag generation and encryption procedure. More... | |
int | tc_ccm_decryption_verification (uint8_t *out, unsigned int olen, const uint8_t *associated_data, unsigned int alen, const uint8_t *payload, unsigned int plen, TCCcmMode_t c) |
CCM decryption and tag verification procedure. More... | |
|
static |
Variation of CBC-MAC mode used in CCM.
|
static |
Variation of CTR mode used in CCM.
The CTR mode used by CCM is slightly different than the conventional CTR mode (the counter is increased before encryption, instead of after encryption). Besides, it is assumed that the counter is stored in the last 2 bytes of the nonce.
int tc_ccm_config | ( | TCCcmMode_t | c, |
TCAesKeySched_t | sched, | ||
uint8_t * | nonce, | ||
unsigned int | nlen, | ||
unsigned int | mlen | ||
) |
CCM configuration procedure.
c | – CCM state |
sched | IN – AES key schedule |
nonce | IN - nonce |
nlen | – nonce length in bytes |
mlen | – mac length in bytes (parameter t in SP-800 38C) |
int tc_ccm_decryption_verification | ( | uint8_t * | out, |
unsigned int | olen, | ||
const uint8_t * | associated_data, | ||
unsigned int | alen, | ||
const uint8_t * | payload, | ||
unsigned int | plen, | ||
TCCcmMode_t | c | ||
) |
CCM decryption and tag verification procedure.
out | OUT – decrypted data |
associated_data | IN – associated data |
alen | IN – associated data length in bytes |
payload | IN – payload |
plen | IN – payload length in bytes |
c | IN – CCM state |
int tc_ccm_generation_encryption | ( | uint8_t * | out, |
unsigned int | olen, | ||
const uint8_t * | associated_data, | ||
unsigned int | alen, | ||
const uint8_t * | payload, | ||
unsigned int | plen, | ||
TCCcmMode_t | c | ||
) |
CCM tag generation and encryption procedure.
out | OUT – encrypted data |
olen | IN – output length in bytes |
associated_data | IN – associated data |
alen | IN – associated data length in bytes |
payload | IN – payload |
plen | IN – payload length in bytes |
c | IN – CCM state |