Lines Matching full:16

41 static int ccm_calculate_X0(const uint8_t key[16], const uint8_t *aad, uint8_t aad_len,  in ccm_calculate_X0()  argument
42 size_t mic_size, uint16_t msg_len, uint8_t b[16], in ccm_calculate_X0() argument
43 uint8_t X0[16]) in ccm_calculate_X0() argument
67 while (aad_len > 16) { in ccm_calculate_X0()
71 } while (i < 16); in ccm_calculate_X0()
73 aad_len -= 16; in ccm_calculate_X0()
86 for (i = aad_len; i < 16; i++) { in ccm_calculate_X0()
99 static int ccm_auth(const uint8_t key[16], uint8_t nonce[13], in ccm_auth() argument
103 uint8_t b[16], Xn[16], s0[16]; in ccm_auth()
107 last_blk = msg_len % 16; in ccm_auth()
108 blk_cnt = (msg_len + 15) / 16; in ccm_auth()
110 last_blk = 16U; in ccm_auth()
130 b[i] = Xn[i] ^ cleartext_msg[(j * 16) + i]; in ccm_auth()
133 memcpy(&b[i], &Xn[i], 16 - i); in ccm_auth()
135 xor16(b, Xn, &cleartext_msg[j * 16]); in ccm_auth()
152 static int ccm_crypt(const uint8_t key[16], const uint8_t nonce[13], in ccm_crypt() argument
155 uint8_t a_i[16], s_i[16]; in ccm_crypt()
160 last_blk = msg_len % 16; in ccm_crypt()
161 blk_cnt = (msg_len + 15) / 16; in ccm_crypt()
163 last_blk = 16U; in ccm_crypt()
180 xor16(&out_msg[j * 16], s_i, &in_msg[j * 16]); in ccm_crypt()
183 out_msg[(j * 16) + i] = in ccm_crypt()
184 in_msg[(j * 16) + i] ^ s_i[i]; in ccm_crypt()
191 int bt_ccm_decrypt(const uint8_t key[16], uint8_t nonce[13], in bt_ccm_decrypt() argument
195 uint8_t mic[16]; in bt_ccm_decrypt()
212 int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], in bt_ccm_encrypt() argument
218 LOG_DBG("key %s", bt_hex(key, 16)); in bt_ccm_encrypt()
224 if (aad_len >= 0xff00 || mic_size > 16 || len > UINT16_MAX) { in bt_ccm_encrypt()