[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZwDHUGIG_BvqJboW@gondor.apana.org.au>
Date: Sat, 5 Oct 2024 12:57:52 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: "David S. Miller" <davem@...emloft.net>, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: hmac - Improve local variable types
On Tue, Sep 24, 2024 at 01:27:27PM +0200, Thorsten Blum wrote:
> Since crypto_shash_blocksize(), crypto_shash_digestsize(), and
> crypto_shash_statesize() return an unsigned int, also use unsigned int
> for the local variables.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
> crypto/hmac.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/crypto/hmac.c b/crypto/hmac.c
> index 7cec25ff9889..6ab7ce4cb930 100644
> --- a/crypto/hmac.c
> +++ b/crypto/hmac.c
> @@ -31,9 +31,9 @@ struct hmac_ctx {
> static int hmac_setkey(struct crypto_shash *parent,
> const u8 *inkey, unsigned int keylen)
> {
> - int bs = crypto_shash_blocksize(parent);
> - int ds = crypto_shash_digestsize(parent);
> - int ss = crypto_shash_statesize(parent);
> + unsigned int bs = crypto_shash_blocksize(parent);
> + unsigned int ds = crypto_shash_digestsize(parent);
> + unsigned int ss = crypto_shash_statesize(parent);
These values are all capped by the API. So I don't think this
churn is worth it.
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