From: Thorsten Blum <blum@kernel.org>
To: Linus Walleij <linusw@kernel.org>, Imre Kaloz <kaloz@openwrt.org>,
Corentin Labbe <clabbe@baylibre.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Cc: Thorsten Blum <blum@kernel.org>,
linux-crypto@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/5] crypto: ixp4xx - use memcpy_and_pad() in register_chain_var()
Date: Mon, 21 Sep 2026 08:11:22 +0200 [thread overview]
Message-ID: <20260921061120.29694-8-blum@kernel.org> (raw)
In-Reply-To: <20260921061120.29694-6-blum@kernel.org>
Use memcpy_and_pad() instead of separate memcpy() and memset() calls to
simplify register_chain_var().
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
index fdda04672454..33e8e887a415 100644
--- a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
+++ b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
@@ -707,8 +707,7 @@ static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target,
return -EAGAIN;
}
- memcpy(pad, key, key_len);
- memset(pad + key_len, 0, HMAC_PAD_BLOCKLEN - key_len);
+ memcpy_and_pad(pad, HMAC_PAD_BLOCKLEN, key, key_len, 0);
for (i = 0; i < HMAC_PAD_BLOCKLEN; i++)
pad[i] ^= xpad;
next prev parent reply other threads:[~2026-09-21 6:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 6:11 [PATCH 1/5] crypto: cast5 - use memcpy_and_pad() in cast5_setkey() Thorsten Blum
2026-09-21 6:11 ` [PATCH 2/5] crypto: cast6 - use memcpy_and_pad() in __cast6_setkey() Thorsten Blum
2026-09-21 6:11 ` Thorsten Blum [this message]
2026-09-21 8:56 ` [PATCH 3/5] crypto: ixp4xx - use memcpy_and_pad() in register_chain_var() Linus Walleij
2026-09-21 6:11 ` [PATCH 4/5] crypto: octeontx - use memcpy_and_pad() in aead_hmac_init() Thorsten Blum
2026-09-21 6:11 ` [PATCH 5/5] crypto: octeontx2 " Thorsten Blum
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=20260921061120.29694-8-blum@kernel.org \
--to=blum@kernel.org \
--cc=clabbe@baylibre.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kaloz@openwrt.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®