diff options
author | Eric Biggers <ebiggers@google.com> | 2020-05-01 22:31:05 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-05-08 15:32:13 +1000 |
commit | 1306664fdeeffc92c31ef034e9f2f5516b0d5c97 (patch) | |
tree | 15411659460fce3c556ce6df86c60e04c8cd6e5c /crypto/essiv.c | |
parent | a221b33b657b911e2cfefc47484b0ab7531b71be (diff) | |
download | linux-next-1306664fdeeffc92c31ef034e9f2f5516b0d5c97.tar.gz |
crypto: essiv - use crypto_shash_tfm_digest()
Instead of manually allocating a 'struct shash_desc' on the stack and
calling crypto_shash_digest(), switch to using the new helper function
crypto_shash_tfm_digest() which does this for us.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/essiv.c')
-rw-r--r-- | crypto/essiv.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/essiv.c b/crypto/essiv.c index 465a89c9d1ef..a7f45dbc4ee2 100644 --- a/crypto/essiv.c +++ b/crypto/essiv.c @@ -66,7 +66,6 @@ static int essiv_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key, unsigned int keylen) { struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); - SHASH_DESC_ON_STACK(desc, tctx->hash); u8 salt[HASH_MAX_DIGESTSIZE]; int err; @@ -78,8 +77,7 @@ static int essiv_skcipher_setkey(struct crypto_skcipher *tfm, if (err) return err; - desc->tfm = tctx->hash; - err = crypto_shash_digest(desc, key, keylen, salt); + err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt); if (err) return err; |