From: Herbert Xu <herbert@gondor.apana.org.au>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: "David S. Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: hmac - Improve local variable types
Date: Sat, 5 Oct 2024 12:57:52 +0800 [thread overview]
Message-ID: <ZwDHUGIG_BvqJboW@gondor.apana.org.au> (raw)
In-Reply-To: <20240924112727.240950-2-thorsten.blum@linux.dev>
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@linux.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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2024-10-05 5:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 11:27 Thorsten Blum
2024-10-05 4:57 ` Herbert Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZwDHUGIG_BvqJboW@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thorsten.blum@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®