[PATCH 5/5] crypto: octeontx2 - use memcpy_and_pad() in aead_hmac_init()
From: Thorsten Blum
Date: Mon Sep 21 2026 - 02:12:40 EST
Use memcpy_and_pad() instead of separate memcpy() and memset() calls to
simplify aead_hmac_init().
Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
---
drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c b/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
index 8d9f394d6b50..65ad29f1e47c 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c
@@ -882,8 +882,7 @@ static int aead_hmac_init(struct crypto_aead *cipher,
ipad = ctx->ipad;
opad = ctx->opad;
- memcpy(ipad, ctx->key, authkeylen);
- memset(ipad + authkeylen, 0, bs - authkeylen);
+ memcpy_and_pad(ipad, bs, ctx->key, authkeylen, 0);
memcpy(opad, ipad, bs);
for (icount = 0; icount < bs; icount++) {