diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-12 18:47:47 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-16 15:36:24 +0800 |
| commit | 90916934fd093edf62bc0c5c9a940a8efa7db2f8 (patch) | |
| tree | 6d8e5ed01337fc3e9d33375ec4e9fe6e52d0081f /crypto/shash.c | |
| parent | aeffd9093820c16e10f61d1c894c16d435b82975 (diff) | |
crypto: shash - Remove dynamic descsize
As all users of the dynamic descsize have been converted to use
a static one instead, remove support for dynamic descsize.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/shash.c')
| -rw-r--r-- | crypto/shash.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index a2a7d6609172..f23bd9cb1873 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -153,9 +153,6 @@ static int crypto_shash_init_tfm(struct crypto_tfm *tfm) { struct crypto_shash *hash = __crypto_shash_cast(tfm); struct shash_alg *alg = crypto_shash_alg(hash); - int err; - - hash->descsize = alg->descsize; shash_set_needkey(hash, alg); @@ -165,18 +162,7 @@ static int crypto_shash_init_tfm(struct crypto_tfm *tfm) if (!alg->init_tfm) return 0; - err = alg->init_tfm(hash); - if (err) - return err; - - /* ->init_tfm() may have increased the descsize. */ - if (WARN_ON_ONCE(hash->descsize > HASH_MAX_DESCSIZE)) { - if (alg->exit_tfm) - alg->exit_tfm(hash); - return -EINVAL; - } - - return 0; + return alg->init_tfm(hash); } static void crypto_shash_free_instance(struct crypto_instance *inst) @@ -274,8 +260,6 @@ struct crypto_shash *crypto_clone_shash(struct crypto_shash *hash) if (IS_ERR(nhash)) return nhash; - nhash->descsize = hash->descsize; - if (alg->clone_tfm) { err = alg->clone_tfm(nhash, hash); if (err) { |
