[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<NT0PR01MB118296A432EFF03E02A6212B8AD42@NT0PR01MB1182.CHNPR01.prod.partner.outlook.cn>
Date: Mon, 24 Jun 2024 02:41:25 +0000
From: JiaJie Ho <jiajie.ho@...rfivetech.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
CC: "David S . Miller" <davem@...emloft.net>, "linux-crypto@...r.kernel.org"
<linux-crypto@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] crypto: starfive - Align rsa input data to 32-bit
> > @@ -217,12 +218,11 @@ struct starfive_cryp_request_ctx {
> > struct scatterlist *out_sg;
> > struct ahash_request ahash_fbk_req;
> > size_t total;
> > - size_t nents;
> > unsigned int blksize;
> > unsigned int digsize;
> > unsigned long in_sg_len;
> > unsigned char *adata;
> > - u8 rsa_data[] __aligned(sizeof(u32));
> > + u8 rsa_data[STARFIVE_RSA_MAX_KEYSZ];
>
> I think you should retain the aligned attribute.
I'll add this back in the next version.
> > @@ -74,14 +73,13 @@ static int starfive_rsa_montgomery_form(struct
> > starfive_cryp_ctx *ctx, {
> > struct starfive_cryp_dev *cryp = ctx->cryp;
> > struct starfive_cryp_request_ctx *rctx = ctx->rctx;
> > - int count = rctx->total / sizeof(u32) - 1;
> > + int count = (ALIGN(rctx->total, sizeof(u32)) >> 2) - 1;
>
> This is a bit confusing. Perhaps use 4 instead of sizeof(u32), i.e.
>
> int count = (ALIGN(rctx->total, 4) / 4) - 1;
>
Will update this too.
> > int loop;
> > u32 temp;
> > u8 opsize;
> >
> > opsize = (bit_len - 1) >> 5;
> > rctx->csr.pka.v = 0;
> > -
>
> Please do not make unrelated changes like this.
Got it. I'll remove it and the unrelated changes in the next version.
Thanks for review this patch.
Best regards,
Jia Jie
Powered by blists - more mailing lists