Lines Matching refs:prot

132 			  struct tls_prot_info *prot, struct sk_buff *skb)  in padding_length()  argument
138 if (prot->version == TLS_1_3_VERSION) { in padding_length()
144 if (back > rxm->full_len - prot->prepend_size) in padding_length()
168 struct tls_prot_info *prot; in tls_decrypt_done() local
177 prot = &tls_ctx->prot_info; in tls_decrypt_done()
190 pad = padding_length(ctx, prot, skb); in tls_decrypt_done()
196 rxm->offset += prot->prepend_size; in tls_decrypt_done()
197 rxm->full_len -= prot->overhead_size; in tls_decrypt_done()
237 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_decryption() local
242 aead_request_set_ad(aead_req, prot->aad_size); in tls_do_decryption()
244 data_len + prot->tag_size, in tls_do_decryption()
282 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_trim_both_msgs() local
288 target_size += prot->overhead_size; in tls_trim_both_msgs()
305 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_clone_plaintext_msg() local
321 skip = prot->prepend_size + msg_pl->sg.size; in tls_clone_plaintext_msg()
329 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_get_rec() local
348 sg_set_buf(&rec->sg_aead_in[0], rec->aad_space, prot->aad_size); in tls_get_rec()
352 sg_set_buf(&rec->sg_aead_out[0], rec->aad_space, prot->aad_size); in tls_get_rec()
441 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_encrypt_done() local
453 sge->offset -= prot->prepend_size; in tls_encrypt_done()
454 sge->length += prot->prepend_size; in tls_encrypt_done()
503 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_do_encryption() local
510 if (prot->cipher_type == TLS_CIPHER_AES_CCM_128) { in tls_do_encryption()
516 prot->iv_size + prot->salt_size); in tls_do_encryption()
518 xor_iv_with_seq(prot, rec->iv_data, tls_ctx->tx.rec_seq); in tls_do_encryption()
520 sge->offset += prot->prepend_size; in tls_do_encryption()
521 sge->length -= prot->prepend_size; in tls_do_encryption()
526 aead_request_set_ad(aead_req, prot->aad_size); in tls_do_encryption()
541 sge->offset -= prot->prepend_size; in tls_do_encryption()
542 sge->length += prot->prepend_size; in tls_do_encryption()
554 tls_advance_record_sn(sk, prot, &tls_ctx->tx); in tls_do_encryption()
680 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_record() local
699 prot->overhead_size > msg_en->sg.size) || in tls_push_record()
702 prot->overhead_size > msg_en->sg.size))) { in tls_push_record()
708 split_point, prot->overhead_size, in tls_push_record()
724 prot->overhead_size); in tls_push_record()
734 if (prot->version == TLS_1_3_VERSION) { in tls_push_record()
760 tls_make_aad(rec->aad_space, msg_pl->sg.size + prot->tail_size, in tls_push_record()
761 tls_ctx->tx.rec_seq, record_type, prot); in tls_push_record()
766 msg_pl->sg.size + prot->tail_size, in tls_push_record()
772 msg_pl->sg.size + prot->tail_size, i); in tls_push_record()
786 sk_msg_trim(sk, msg_en, msg_pl->sg.size + prot->overhead_size); in tls_push_record()
928 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_sendmsg() local
992 prot->overhead_size; in tls_sw_sendmsg()
1060 msg_pl->sg.size + prot->overhead_size); in tls_sw_sendmsg()
1154 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_do_sendpage() local
1196 required_size = msg_pl->sg.size + copy + prot->overhead_size; in tls_sw_do_sendpage()
1416 struct tls_prot_info *prot = &tls_ctx->prot_info; in decrypt_internal() local
1424 const int data_len = rxm->full_len - prot->overhead_size + in decrypt_internal()
1425 prot->tail_size; in decrypt_internal()
1433 n_sgin = skb_nsg(skb, rxm->offset + prot->prepend_size, in decrypt_internal()
1434 rxm->full_len - prot->prepend_size); in decrypt_internal()
1451 mem_size = mem_size + prot->aad_size; in decrypt_internal()
1467 iv = aad + prot->aad_size; in decrypt_internal()
1470 if (prot->cipher_type == TLS_CIPHER_AES_CCM_128) { in decrypt_internal()
1477 iv + iv_offset + prot->salt_size, in decrypt_internal()
1478 prot->iv_size); in decrypt_internal()
1483 if (prot->version == TLS_1_3_VERSION || in decrypt_internal()
1484 prot->cipher_type == TLS_CIPHER_CHACHA20_POLY1305) in decrypt_internal()
1488 memcpy(iv + iv_offset, tls_ctx->rx.iv, prot->salt_size); in decrypt_internal()
1490 xor_iv_with_seq(prot, iv, tls_ctx->rx.rec_seq); in decrypt_internal()
1493 tls_make_aad(aad, rxm->full_len - prot->overhead_size + in decrypt_internal()
1494 prot->tail_size, in decrypt_internal()
1495 tls_ctx->rx.rec_seq, ctx->control, prot); in decrypt_internal()
1499 sg_set_buf(&sgin[0], aad, prot->aad_size); in decrypt_internal()
1501 rxm->offset + prot->prepend_size, in decrypt_internal()
1502 rxm->full_len - prot->prepend_size); in decrypt_internal()
1511 sg_set_buf(&sgout[0], aad, prot->aad_size); in decrypt_internal()
1552 struct tls_prot_info *prot = &tls_ctx->prot_info; in decrypt_skb_update() local
1569 tls_advance_record_sn(sk, prot, in decrypt_skb_update()
1580 pad = padding_length(ctx, prot, skb); in decrypt_skb_update()
1585 rxm->offset += prot->prepend_size; in decrypt_skb_update()
1586 rxm->full_len -= prot->overhead_size; in decrypt_skb_update()
1587 tls_advance_record_sn(sk, prot, &tls_ctx->rx); in decrypt_skb_update()
1748 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_sw_recvmsg() local
1814 if (prot->version == TLS_1_3_VERSION) in tls_sw_recvmsg()
1822 to_decrypt = rxm->full_len - prot->overhead_size; in tls_sw_recvmsg()
1826 prot->version != TLS_1_3_VERSION && in tls_sw_recvmsg()
1846 } else if (prot->version == TLS_1_3_VERSION) { in tls_sw_recvmsg()
2059 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_read_size() local
2067 if (rxm->offset + prot->prepend_size > skb->len) in tls_read_size()
2071 if (WARN_ON(prot->prepend_size > sizeof(header))) { in tls_read_size()
2077 ret = skb_copy_bits(skb, rxm->offset, header, prot->prepend_size); in tls_read_size()
2086 cipher_overhead = prot->tag_size; in tls_read_size()
2087 if (prot->version != TLS_1_3_VERSION && in tls_read_size()
2088 prot->cipher_type != TLS_CIPHER_CHACHA20_POLY1305) in tls_read_size()
2089 cipher_overhead += prot->iv_size; in tls_read_size()
2092 prot->tail_size) { in tls_read_size()
2303 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_sw_offload() local
2450 prot->aad_size = TLS_HEADER_SIZE; in tls_set_sw_offload()
2451 prot->tail_size = 1; in tls_set_sw_offload()
2453 prot->aad_size = TLS_AAD_SPACE_SIZE; in tls_set_sw_offload()
2454 prot->tail_size = 0; in tls_set_sw_offload()
2457 prot->version = crypto_info->version; in tls_set_sw_offload()
2458 prot->cipher_type = crypto_info->cipher_type; in tls_set_sw_offload()
2459 prot->prepend_size = TLS_HEADER_SIZE + nonce_size; in tls_set_sw_offload()
2460 prot->tag_size = tag_size; in tls_set_sw_offload()
2461 prot->overhead_size = prot->prepend_size + in tls_set_sw_offload()
2462 prot->tag_size + prot->tail_size; in tls_set_sw_offload()
2463 prot->iv_size = iv_size; in tls_set_sw_offload()
2464 prot->salt_size = salt_size; in tls_set_sw_offload()
2471 prot->rec_seq_size = rec_seq_size; in tls_set_sw_offload()
2496 rc = crypto_aead_setauthsize(*aead, prot->tag_size); in tls_set_sw_offload()