ext/lib/crypto/tinycrypt/source/ccm_mode.c
/**
 * Variation of CBC-MAC mode used in CCM.
 */
Variation of CBC-MAC mode used in CCM.
Variation of CBC - MAC mode used in CCM .
static void ccm_cbc_mac(uint8_t *T, const uint8_t *data, uint32_t dlen,
			 uint32_t flag, TCAesKeySched_t sched)
{
	uint32_t i;
	if (flag > 0) {
		T[0] ^= (uint8_t)(dlen >> 8);
		T[1] ^= (uint8_t)(dlen);
		dlen += 2; i = 2;
	} else {
		i = 0;
	}
	while (i < dlen) {
		T[i++ % (Nb * Nk)] ^= *data++;
		if (((i % (Nb * Nk)) == 0) || dlen == i) {
			(void) tc_aes_encrypt(T, T, sched);
		}
	}
}
static void ccm_cbc_mac ( uint8_t * T , const uint8_t * data , uint32_t dlen , uint32_t flag , TCAesKeySched_t sched ) { uint32_t i ; if ( flag > 0 ) { T [ 0 ] ^= ( uint8_t ) ( dlen >> 8 ) ; T [ 1 ] ^= ( uint8_t ) ( dlen ) ; dlen += 2 ; i = 2 ; } else { i = 0 ; } while ( i < dlen ) { T [ i ++ % ( Nb * Nk ) ] ^= * data ++ ; if ( ( ( i % ( Nb * Nk ) ) == 0 ) || dlen == i ) { ( void ) tc_aes_encrypt ( T , T , sched ) ; } } }
Variation of CBC-MAC mode used in CCM.
Variation of CBC - MAC mode used in CCM .