diff mbox series

[v2,4/6] crypto: shash - Set reqsize in shash_alg

Message ID 7cdd299b7111b6218042f6e50118812452db6a73.1746954402.git.herbert@gondor.apana.org.au
State New
Headers show
Series crypto: Add partial block API and hmac to ahash | expand

Commit Message

Herbert Xu May 11, 2025, 9:09 a.m. UTC
Make reqsize static for shash algorithms.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
 crypto/ahash.c | 1 -
 crypto/shash.c | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/crypto/ahash.c b/crypto/ahash.c
index c474aad88f68..8f0215b2bfc4 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -286,7 +286,6 @@  static int crypto_init_ahash_using_shash(struct crypto_tfm *tfm)
 
 	crypto_ahash_set_flags(crt, crypto_shash_get_flags(shash) &
 				    CRYPTO_TFM_NEED_KEY);
-	crt->reqsize = sizeof(struct shash_desc) + crypto_shash_descsize(shash);
 
 	return 0;
 }
diff --git a/crypto/shash.c b/crypto/shash.c
index dee391d47f51..dd3b7de89309 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -483,6 +483,8 @@  static int shash_prepare_alg(struct shash_alg *alg)
 	if (alg->statesize > HASH_MAX_STATESIZE)
 		return -EINVAL;
 
+	base->cra_reqsize = sizeof(struct shash_desc) + alg->descsize;
+
 	return 0;
 }