[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02e70357-1a3a-44f4-b25d-0e8e7f430cb6@hisilicon.com>
Date: Sat, 26 Oct 2024 15:50:58 +0800
From: "linwenkai (C)" <linwenkai6@...ilicon.com>
To: Herbert Xu <herbert@...dor.apana.org.au>, Chenghai Huang
<huangchenghai2@...wei.com>
CC: <davem@...emloft.net>, <linux-kernel@...r.kernel.org>,
<linux-crypto@...r.kernel.org>, <liulongfang@...wei.com>,
<shenyang39@...wei.com>, <qianweili@...wei.com>, <wangzhou1@...ilicon.com>
Subject: Re: [PATCH v2 1/2] crypto: hisilicon/sec2 - fix for aead icv error
在 2024/10/26 14:30, Herbert Xu 写道:
> On Fri, Oct 18, 2024 at 06:58:29PM +0800, Chenghai Huang wrote:
>> @@ -911,10 +910,8 @@ static int sec_cipher_pbuf_map(struct sec_ctx *ctx, struct sec_req *req,
>> return -EINVAL;
>> }
>> if (!c_req->encrypt && ctx->alg_type == SEC_AEAD) {
>> - tfm = crypto_aead_reqtfm(aead_req);
>> - authsize = crypto_aead_authsize(tfm);
>> - mac_offset = qp_ctx->res[req_id].pbuf + copy_size - authsize;
>> - memcpy(a_req->out_mac, mac_offset, authsize);
>> + mac_offset = qp_ctx->res[req_id].pbuf + copy_size - a_ctx->authsize;
>> + memcpy(a_req->out_mac, mac_offset, a_ctx->authsize);
> You've lost me. a_ctx->authsize is set to the value of
> crypto_aead_authsize(tfm). In other words nothing has changed.
> What am I missing?
>
>> @@ -2356,10 +2331,12 @@ static int sec_aead_crypto(struct aead_request *a_req, bool encrypt)
>> struct crypto_aead *tfm = crypto_aead_reqtfm(a_req);
>> struct sec_req *req = aead_request_ctx(a_req);
>> struct sec_ctx *ctx = crypto_aead_ctx(tfm);
>> + struct sec_auth_ctx *a_ctx = &ctx->a_ctx;
>> int ret;
>>
>> req->flag = a_req->base.flags;
>> req->aead_req.aead_req = a_req;
>> + a_ctx->authsize = crypto_aead_authsize(tfm);
>> req->c_req.encrypt = encrypt;
>> req->ctx = ctx;
> Cheers,
Hi, do you want me to remove this variable and use the old way to get
the authsize?
The variable is added to make code simple and to reduce some function calls.
Thanks.
Powered by blists - more mailing lists