Lines Matching refs:prot

122 			  struct tls_prot_info *prot, struct sk_buff *skb)  in padding_length()  argument
128 if (prot->version == TLS_1_3_VERSION) { in padding_length()
134 if (back > rxm->full_len - prot->prepend_size) in padding_length()
158 struct tls_prot_info *prot; in tls_decrypt_done() local
167 prot = &tls_ctx->prot_info; in tls_decrypt_done()
177 pad = padding_length(ctx, prot, skb); in tls_decrypt_done()
183 rxm->offset += prot->prepend_size; in tls_decrypt_done()
184 rxm->full_len -= prot->overhead_size; in tls_decrypt_done()
222 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_decryption() local
227 aead_request_set_ad(aead_req, prot->aad_size); in tls_do_decryption()
229 data_len + prot->tag_size, in tls_do_decryption()
267 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_trim_both_msgs() local
273 target_size += prot->overhead_size; in tls_trim_both_msgs()
290 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_clone_plaintext_msg() local
306 skip = prot->prepend_size + msg_pl->sg.size; in tls_clone_plaintext_msg()
314 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_get_rec() local
333 sg_set_buf(&rec->sg_aead_in[0], rec->aad_space, prot->aad_size); in tls_get_rec()
337 sg_set_buf(&rec->sg_aead_out[0], rec->aad_space, prot->aad_size); in tls_get_rec()
426 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_encrypt_done() local
438 sge->offset -= prot->prepend_size; in tls_encrypt_done()
439 sge->length += prot->prepend_size; in tls_encrypt_done()
486 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_encryption() local
493 if (prot->cipher_type == TLS_CIPHER_AES_CCM_128) { in tls_do_encryption()
499 prot->iv_size + prot->salt_size); in tls_do_encryption()
501 xor_iv_with_seq(prot->version, rec->iv_data, tls_ctx->tx.rec_seq); in tls_do_encryption()
503 sge->offset += prot->prepend_size; in tls_do_encryption()
504 sge->length -= prot->prepend_size; in tls_do_encryption()
509 aead_request_set_ad(aead_req, prot->aad_size); in tls_do_encryption()
524 sge->offset -= prot->prepend_size; in tls_do_encryption()
525 sge->length += prot->prepend_size; in tls_do_encryption()
537 tls_advance_record_sn(sk, prot, &tls_ctx->tx); in tls_do_encryption()
663 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_record() local
682 split_point, prot->overhead_size, in tls_push_record()
687 prot->overhead_size); in tls_push_record()
697 if (prot->version == TLS_1_3_VERSION) { in tls_push_record()
718 tls_make_aad(rec->aad_space, msg_pl->sg.size + prot->tail_size, in tls_push_record()
719 tls_ctx->tx.rec_seq, prot->rec_seq_size, in tls_push_record()
720 record_type, prot->version); in tls_push_record()
725 msg_pl->sg.size + prot->tail_size, in tls_push_record()
726 record_type, prot->version); in tls_push_record()
731 msg_pl->sg.size + prot->tail_size, i); in tls_push_record()
745 sk_msg_trim(sk, msg_en, msg_pl->sg.size + prot->overhead_size); in tls_push_record()
880 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_sendmsg() local
941 prot->overhead_size; in tls_sw_sendmsg()
1011 msg_pl->sg.size + prot->overhead_size); in tls_sw_sendmsg()
1098 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_do_sendpage() local
1140 required_size = msg_pl->sg.size + copy + prot->overhead_size; in tls_sw_do_sendpage()
1353 struct tls_prot_info *prot = &tls_ctx->prot_info; in decrypt_internal() local
1361 const int data_len = rxm->full_len - prot->overhead_size + in decrypt_internal()
1362 prot->tail_size; in decrypt_internal()
1370 n_sgin = skb_nsg(skb, rxm->offset + prot->prepend_size, in decrypt_internal()
1371 rxm->full_len - prot->prepend_size); in decrypt_internal()
1388 mem_size = mem_size + prot->aad_size; in decrypt_internal()
1404 iv = aad + prot->aad_size; in decrypt_internal()
1407 if (prot->cipher_type == TLS_CIPHER_AES_CCM_128) { in decrypt_internal()
1414 iv + iv_offset + prot->salt_size, in decrypt_internal()
1415 prot->iv_size); in decrypt_internal()
1420 if (prot->version == TLS_1_3_VERSION) in decrypt_internal()
1424 memcpy(iv + iv_offset, tls_ctx->rx.iv, prot->salt_size); in decrypt_internal()
1426 xor_iv_with_seq(prot->version, iv, tls_ctx->rx.rec_seq); in decrypt_internal()
1429 tls_make_aad(aad, rxm->full_len - prot->overhead_size + in decrypt_internal()
1430 prot->tail_size, in decrypt_internal()
1431 tls_ctx->rx.rec_seq, prot->rec_seq_size, in decrypt_internal()
1432 ctx->control, prot->version); in decrypt_internal()
1436 sg_set_buf(&sgin[0], aad, prot->aad_size); in decrypt_internal()
1438 rxm->offset + prot->prepend_size, in decrypt_internal()
1439 rxm->full_len - prot->prepend_size); in decrypt_internal()
1448 sg_set_buf(&sgout[0], aad, prot->aad_size); in decrypt_internal()
1489 struct tls_prot_info *prot = &tls_ctx->prot_info; in decrypt_skb_update() local
1506 tls_advance_record_sn(sk, prot, in decrypt_skb_update()
1515 pad = padding_length(ctx, prot, skb); in decrypt_skb_update()
1520 rxm->offset += prot->prepend_size; in decrypt_skb_update()
1521 rxm->full_len -= prot->overhead_size; in decrypt_skb_update()
1522 tls_advance_record_sn(sk, prot, &tls_ctx->rx); in decrypt_skb_update()
1683 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_recvmsg() local
1746 if (prot->version == TLS_1_3_VERSION) in tls_sw_recvmsg()
1754 to_decrypt = rxm->full_len - prot->overhead_size; in tls_sw_recvmsg()
1758 prot->version != TLS_1_3_VERSION) in tls_sw_recvmsg()
1777 } else if (prot->version == TLS_1_3_VERSION) { in tls_sw_recvmsg()
1971 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_read_size() local
1979 if (rxm->offset + prot->prepend_size > skb->len) in tls_read_size()
1983 if (WARN_ON(prot->prepend_size > sizeof(header))) { in tls_read_size()
1989 ret = skb_copy_bits(skb, rxm->offset, header, prot->prepend_size); in tls_read_size()
1998 cipher_overhead = prot->tag_size; in tls_read_size()
1999 if (prot->version != TLS_1_3_VERSION) in tls_read_size()
2000 cipher_overhead += prot->iv_size; in tls_read_size()
2003 prot->tail_size) { in tls_read_size()
2207 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_sw_offload() local
2336 prot->aad_size = TLS_HEADER_SIZE; in tls_set_sw_offload()
2337 prot->tail_size = 1; in tls_set_sw_offload()
2339 prot->aad_size = TLS_AAD_SPACE_SIZE; in tls_set_sw_offload()
2340 prot->tail_size = 0; in tls_set_sw_offload()
2343 prot->version = crypto_info->version; in tls_set_sw_offload()
2344 prot->cipher_type = crypto_info->cipher_type; in tls_set_sw_offload()
2345 prot->prepend_size = TLS_HEADER_SIZE + nonce_size; in tls_set_sw_offload()
2346 prot->tag_size = tag_size; in tls_set_sw_offload()
2347 prot->overhead_size = prot->prepend_size + in tls_set_sw_offload()
2348 prot->tag_size + prot->tail_size; in tls_set_sw_offload()
2349 prot->iv_size = iv_size; in tls_set_sw_offload()
2350 prot->salt_size = salt_size; in tls_set_sw_offload()
2357 prot->rec_seq_size = rec_seq_size; in tls_set_sw_offload()
2382 rc = crypto_aead_setauthsize(*aead, prot->tag_size); in tls_set_sw_offload()