Lines Matching refs:apkt
1157 struct cipher_aead_pkt *apkt, uint8_t m) in generate_nonce() argument
1159 nonce[0] = 0 | (apkt->ad_len ? 0x40 : 0) | (m << 3) | 1; in generate_nonce()
1163 nonce[14] = (uint8_t)(apkt->pkt->in_len >> 8); in generate_nonce()
1164 nonce[15] = (uint8_t)(apkt->pkt->in_len); in generate_nonce()
1171 struct cipher_aead_pkt *apkt, in insert_crypto_parameters() argument
1180 if (!apkt->pkt->out_buf || !apkt->pkt->out_buf_max) { in insert_crypto_parameters()
1195 if (!apkt->ad || !apkt->ad_len) { in insert_crypto_parameters()
1200 if (apkt->pkt->in_buf && apkt->pkt->in_buf - apkt->ad_len != apkt->ad) { in insert_crypto_parameters()
1205 if (!apkt->pkt->in_buf) { in insert_crypto_parameters()
1211 in_buf = apkt->ad; in insert_crypto_parameters()
1212 in_len = apkt->ad_len; in insert_crypto_parameters()
1218 memcpy(in_buf, apkt->ad, apkt->ad_len); in insert_crypto_parameters()
1219 memcpy(in_buf + apkt->ad_len, in insert_crypto_parameters()
1220 apkt->pkt->in_buf, apkt->pkt->in_len); in insert_crypto_parameters()
1221 in_len = apkt->ad_len + apkt->pkt->in_len; in insert_crypto_parameters()
1223 *auth_crypt = !apkt->tag ? apkt->pkt->in_len : in insert_crypto_parameters()
1224 apkt->pkt->in_len - ctx->mode_params.ccm_info.tag_len; in insert_crypto_parameters()
1250 generate_nonce(ccm_nonce, data, apkt, m); in insert_crypto_parameters()
1262 struct cipher_aead_pkt *apkt, in cc2520_crypto_ccm() argument
1269 if (!apkt || !apkt->pkt) { in cc2520_crypto_ccm()
1274 m = insert_crypto_parameters(ctx, apkt, ccm_nonce, &auth_crypt); in cc2520_crypto_ccm()
1280 apkt->pkt->out_len = apkt->pkt->in_len + apkt->ad_len + in cc2520_crypto_ccm()
1283 if (apkt->pkt->out_len > apkt->pkt->out_buf_max) { in cc2520_crypto_ccm()
1285 apkt->pkt->out_len, apkt->pkt->out_buf_max); in cc2520_crypto_ccm()
1291 0x000, apkt->ad_len, m) || in cc2520_crypto_ccm()
1293 apkt->pkt->out_buf, apkt->pkt->out_len)) { in cc2520_crypto_ccm()
1298 if (apkt->tag) { in cc2520_crypto_ccm()
1299 memcpy(apkt->tag, apkt->pkt->out_buf + apkt->pkt->in_len, in cc2520_crypto_ccm()
1307 struct cipher_aead_pkt *apkt, in cc2520_crypto_uccm() argument
1314 if (!apkt || !apkt->pkt) { in cc2520_crypto_uccm()
1319 if (ctx->mode_params.ccm_info.tag_len && !apkt->tag) { in cc2520_crypto_uccm()
1324 m = insert_crypto_parameters(ctx, apkt, ccm_nonce, &auth_crypt); in cc2520_crypto_uccm()
1329 apkt->pkt->out_len = apkt->pkt->in_len + apkt->ad_len; in cc2520_crypto_uccm()
1333 0x000, apkt->ad_len, m) || in cc2520_crypto_uccm()
1335 apkt->pkt->out_buf, apkt->pkt->out_len)) { in cc2520_crypto_uccm()