crypto: shash - Set reqsize in shash_alg

Make reqsize static for shash algorithms.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Herbert Xu 2025-05-15 13:54:44 +08:00
parent 8cf4c341f1
commit 32a9fd8f49
2 changed files with 2 additions and 1 deletions

View File

@ -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_ahash_set_flags(crt, crypto_shash_get_flags(shash) &
CRYPTO_TFM_NEED_KEY); CRYPTO_TFM_NEED_KEY);
crt->reqsize = sizeof(struct shash_desc) + crypto_shash_descsize(shash);
return 0; return 0;
} }

View File

@ -511,6 +511,8 @@ static int shash_prepare_alg(struct shash_alg *alg)
if (alg->statesize > HASH_MAX_STATESIZE) if (alg->statesize > HASH_MAX_STATESIZE)
return -EINVAL; return -EINVAL;
base->cra_reqsize = sizeof(struct shash_desc) + alg->descsize;
return 0; return 0;
} }