summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-04-20 18:05:16 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-05-12 18:48:01 +0800
commit527e383c1fc9e00a6a917d8799724580974968b3 (patch)
tree25bd1705f9c8912de2e2842050637a542dcb1ac0 /crypto
parente60bd99e21a31895365d24377fd89b57e838d363 (diff)
downloadlinux-crypto-527e383c1fc9e00a6a917d8799724580974968b3.tar.gz
linux-crypto-527e383c1fc9e00a6a917d8799724580974968b3.zip
crypto: hash - Add statesize to crypto_ahash
As ahash drivers may need to use fallbacks, their state size is thus variable. Deal with this by making it an attribute of crypto_ahash. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/ahash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/ahash.c b/crypto/ahash.c
index 32465104..99867382 100644
--- a/crypto/ahash.c
+++ b/crypto/ahash.c
@@ -432,6 +432,8 @@ static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
hash->setkey = ahash_nosetkey;
+ crypto_ahash_set_statesize(hash, alg->halg.statesize);
+
if (tfm->__crt_alg->cra_type != &crypto_ahash_type)
return crypto_init_shash_ops_async(tfm);
@@ -573,6 +575,7 @@ struct crypto_ahash *crypto_clone_ahash(struct crypto_ahash *hash)
nhash->import = hash->import;
nhash->setkey = hash->setkey;
nhash->reqsize = hash->reqsize;
+ nhash->statesize = hash->statesize;
if (tfm->__crt_alg->cra_type != &crypto_ahash_type)
return crypto_clone_shash_ops_async(nhash, hash);