* [PATCH] crypto: atmel-sha - use memcpy_and_pad to simplify hmac_setup
@ 2026-05-16 23:42 Thorsten Blum
2026-05-22 12:34 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-05-16 23:42 UTC (permalink / raw)
To: Herbert Xu, David S. Miller, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Thorsten Blum, linux-crypto, linux-arm-kernel, linux-kernel
Use memcpy_and_pad() instead of memcpy() followed by memset() to
simplify atmel_sha_hmac_setup().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/crypto/atmel-sha.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 1f1341a16c42..f60c7c8cf912 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1731,8 +1731,7 @@ static int atmel_sha_hmac_setup(struct atmel_sha_dev *dd,
return atmel_sha_hmac_prehash_key(dd, key, keylen);
/* Prepare ipad. */
- memcpy((u8 *)hmac->ipad, key, keylen);
- memset((u8 *)hmac->ipad + keylen, 0, bs - keylen);
+ memcpy_and_pad(hmac->ipad, bs, key, keylen, 0);
return atmel_sha_hmac_compute_ipad_hash(dd);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: atmel-sha - use memcpy_and_pad to simplify hmac_setup
2026-05-16 23:42 [PATCH] crypto: atmel-sha - use memcpy_and_pad to simplify hmac_setup Thorsten Blum
@ 2026-05-22 12:34 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-05-22 12:34 UTC (permalink / raw)
To: Thorsten Blum
Cc: David S. Miller, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, linux-crypto, linux-arm-kernel, linux-kernel
On Sun, May 17, 2026 at 01:42:12AM +0200, Thorsten Blum wrote:
> Use memcpy_and_pad() instead of memcpy() followed by memset() to
> simplify atmel_sha_hmac_setup().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/crypto/atmel-sha.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Patch applied. 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-22 12:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-16 23:42 [PATCH] crypto: atmel-sha - use memcpy_and_pad to simplify hmac_setup Thorsten Blum
2026-05-22 12:34 ` Herbert Xu
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®