[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y+YSaEIb1C6TsAHC@gondor.apana.org.au>
Date: Fri, 10 Feb 2023 17:46:16 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, linux-crypto@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: arm64/sm4-ccm - Rewrite skcipher walker loop
On Wed, Feb 01, 2023 at 08:32:07PM +0800, Tianjia Zhang wrote:
> The fact that an error in the skcipher walker API are indicated
> not only by a non-zero return value, but also by the fact that
> walk->nbytes is zero, causes the layout of the skcipher walker
> loop to be sufficiently different from the usual layout, which
> is not a problem in itself, but it is likely to cause reading
> confusion and difficulty in code maintenance.
>
> This patch rewrites skcipher walker loop, and separates the
> last chunk cryption from the loop to avoid wrong calls to the
> skcipher walker API. In addition to following the usual convention
> of checking walk->nbytes, it also makes the loop execute logic
> clearer and easier to understand.
>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
> ---
> arch/arm64/crypto/sm4-ce-ccm-glue.c | 44 ++++++++++++++++-------------
> 1 file changed, 24 insertions(+), 20 deletions(-)
Patch applied. Thanks.
--
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