From 404aac318dceb271c02577f3b5fc4f3788742ae5 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Mon, 21 Sep 2026 08:11:24 +0200 Subject: [PATCH] crypto: octeontx2 - use memcpy_and_pad() in aead_hmac_init() Use memcpy_and_pad() instead of separate memcpy() and memset() calls to simplify aead_hmac_init(). Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- 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 3ccf17d031c6..9eb5dc0a4da6 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c +++ b/drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c @@ -883,8 +883,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++) {