Lines Matching refs:aad_len
41 static int ccm_calculate_X0(const uint8_t key[16], const uint8_t *aad, uint8_t aad_len, in ccm_calculate_X0() argument
48 b[0] = (((mic_size - 2) / 2) << 3) | ((!!aad_len) << 6) | 0x01; in ccm_calculate_X0()
58 if (aad_len) { in ccm_calculate_X0()
59 sys_put_be16(aad_len, b); in ccm_calculate_X0()
66 aad_len += sizeof(uint16_t); in ccm_calculate_X0()
67 while (aad_len > 16) { in ccm_calculate_X0()
73 aad_len -= 16; in ccm_calculate_X0()
82 for (; i < aad_len; i++, j++) { in ccm_calculate_X0()
86 for (i = aad_len; i < 16; i++) { in ccm_calculate_X0()
101 size_t aad_len, uint8_t *mic, size_t mic_size) in ccm_auth() argument
124 ccm_calculate_X0(key, aad, aad_len, mic_size, msg_len, b, Xn); in ccm_auth()
193 size_t aad_len, uint8_t *plaintext, size_t mic_size) in bt_ccm_decrypt() argument
197 if (aad_len >= 0xff00 || mic_size > sizeof(mic) || len > UINT16_MAX) { in bt_ccm_decrypt()
203 ccm_auth(key, nonce, plaintext, len, aad, aad_len, mic, mic_size); in bt_ccm_decrypt()
214 size_t aad_len, uint8_t *enc_data, size_t mic_size) in bt_ccm_encrypt() argument
221 LOG_DBG("aad_len %zu mic_size %zu", aad_len, mic_size); in bt_ccm_encrypt()
224 if (aad_len >= 0xff00 || mic_size > 16 || len > UINT16_MAX) { in bt_ccm_encrypt()
228 ccm_auth(key, nonce, plaintext, len, aad, aad_len, mic, mic_size); in bt_ccm_encrypt()