* [PATCH] crypto: qce - use memcpy_and_pad in qce_aead_setkey
@ 2026-03-21 13:14 Thorsten Blum
2026-03-23 10:47 ` Konrad Dybcio
2026-03-27 10:10 ` Herbert Xu
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-03-21 13:14 UTC (permalink / raw)
To: Thara Gopinath, Herbert Xu, David S. Miller
Cc: Thorsten Blum, linux-crypto, linux-arm-msm, linux-kernel
Replace memset() followed by memcpy() with memcpy_and_pad() to simplify
the code and to write to ->auth_key only once.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/crypto/qce/aead.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/qce/aead.c b/drivers/crypto/qce/aead.c
index 846e1d42775d..425ee6703e3e 100644
--- a/drivers/crypto/qce/aead.c
+++ b/drivers/crypto/qce/aead.c
@@ -642,8 +642,8 @@ static int qce_aead_setkey(struct crypto_aead *tfm, const u8 *key, unsigned int
memcpy(ctx->enc_key, authenc_keys.enckey, authenc_keys.enckeylen);
- memset(ctx->auth_key, 0, sizeof(ctx->auth_key));
- memcpy(ctx->auth_key, authenc_keys.authkey, authenc_keys.authkeylen);
+ memcpy_and_pad(ctx->auth_key, sizeof(ctx->auth_key),
+ authenc_keys.authkey, authenc_keys.authkeylen, 0);
return crypto_aead_setkey(ctx->fallback, key, keylen);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: qce - use memcpy_and_pad in qce_aead_setkey
2026-03-21 13:14 [PATCH] crypto: qce - use memcpy_and_pad in qce_aead_setkey Thorsten Blum
@ 2026-03-23 10:47 ` Konrad Dybcio
2026-03-27 10:10 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2026-03-23 10:47 UTC (permalink / raw)
To: Thorsten Blum, Thara Gopinath, Herbert Xu, David S. Miller
Cc: linux-crypto, linux-arm-msm, linux-kernel
On 3/21/26 2:14 PM, Thorsten Blum wrote:
> Replace memset() followed by memcpy() with memcpy_and_pad() to simplify
> the code and to write to ->auth_key only once.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: qce - use memcpy_and_pad in qce_aead_setkey
2026-03-21 13:14 [PATCH] crypto: qce - use memcpy_and_pad in qce_aead_setkey Thorsten Blum
2026-03-23 10:47 ` Konrad Dybcio
@ 2026-03-27 10:10 ` Herbert Xu
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2026-03-27 10:10 UTC (permalink / raw)
To: Thorsten Blum
Cc: Thara Gopinath, David S. Miller, linux-crypto, linux-arm-msm,
linux-kernel
On Sat, Mar 21, 2026 at 02:14:39PM +0100, Thorsten Blum wrote:
> Replace memset() followed by memcpy() with memcpy_and_pad() to simplify
> the code and to write to ->auth_key only once.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/crypto/qce/aead.c | 4 ++--
> 1 file changed, 2 insertions(+), 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] 3+ messages in thread
end of thread, other threads:[~2026-03-27 10:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21 13:14 [PATCH] crypto: qce - use memcpy_and_pad in qce_aead_setkey Thorsten Blum
2026-03-23 10:47 ` Konrad Dybcio
2026-03-27 10:10 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox