Lines Matching refs:b
154 uint8_t b[Nb * Nk]; in tc_ccm_generation_encryption() local
161 b[0] = ((alen > 0) ? 0x40:0) | (((c->mlen - 2) / 2 << 3)) | (1); in tc_ccm_generation_encryption()
163 b[i] = c->nonce[i - 1]; in tc_ccm_generation_encryption()
165 b[14] = (uint8_t)(plen >> 8); in tc_ccm_generation_encryption()
166 b[15] = (uint8_t)(plen); in tc_ccm_generation_encryption()
169 (void) tc_aes_encrypt(tag, b, c->sched); in tc_ccm_generation_encryption()
180 b[0] = 1; /* q - 1 = 2 - 1 = 1 */ in tc_ccm_generation_encryption()
181 b[14] = b[15] = TC_ZERO_BYTE; in tc_ccm_generation_encryption()
184 ccm_ctr_mode(out, plen, payload, plen, b, c->sched); in tc_ccm_generation_encryption()
186 b[14] = b[15] = TC_ZERO_BYTE; /* restoring initial counter for ctr_mode (0):*/ in tc_ccm_generation_encryption()
189 (void) tc_aes_encrypt(b, b, c->sched); in tc_ccm_generation_encryption()
192 *out++ = tag[i] ^ b[i]; in tc_ccm_generation_encryption()
215 uint8_t b[Nb * Nk]; in tc_ccm_decryption_verification() local
222 b[0] = 1; /* q - 1 = 2 - 1 = 1 */ in tc_ccm_decryption_verification()
224 b[i] = c->nonce[i - 1]; in tc_ccm_decryption_verification()
226 b[14] = b[15] = TC_ZERO_BYTE; /* initial counter value is 0 */ in tc_ccm_decryption_verification()
229 ccm_ctr_mode(out, plen - c->mlen, payload, plen - c->mlen, b, c->sched); in tc_ccm_decryption_verification()
231 b[14] = b[15] = TC_ZERO_BYTE; /* restoring initial counter value (0) */ in tc_ccm_decryption_verification()
234 (void) tc_aes_encrypt(b, b, c->sched); in tc_ccm_decryption_verification()
236 tag[i] = *(payload + plen - c->mlen + i) ^ b[i]; in tc_ccm_decryption_verification()
242 b[0] = ((alen > 0) ? 0x40:0)|(((c->mlen - 2) / 2 << 3)) | (1); in tc_ccm_decryption_verification()
244 b[i] = c->nonce[i - 1]; in tc_ccm_decryption_verification()
246 b[14] = (uint8_t)((plen - c->mlen) >> 8); in tc_ccm_decryption_verification()
247 b[15] = (uint8_t)(plen - c->mlen); in tc_ccm_decryption_verification()
250 (void) tc_aes_encrypt(b, b, c->sched); in tc_ccm_decryption_verification()
252 ccm_cbc_mac(b, associated_data, alen, 1, c->sched); in tc_ccm_decryption_verification()
255 ccm_cbc_mac(b, out, plen - c->mlen, 0, c->sched); in tc_ccm_decryption_verification()
259 if (_compare(b, tag, c->mlen) == 0) { in tc_ccm_decryption_verification()