[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxyMnWbTkf7JEnT7@gondor.apana.org.au>
Date: Sat, 26 Oct 2024 14:30:53 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: 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,
linwenkai6@...ilicon.com, wangzhou1@...ilicon.com
Subject: Re: [PATCH v2 1/2] crypto: hisilicon/sec2 - fix for aead icv error
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,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists