summaryrefslogtreecommitdiff
path: root/drivers/crypto/mediatek
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-01 22:31:10 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 15:32:13 +1000
commite0077ea8ee1774cb99cf9adf10dd4e6dcbf363b0 (patch)
tree20cae2386dd1ab73d010e408eb7c81938dc64336 /drivers/crypto/mediatek
parent61c38e3a94f26035104aec643ee17e80e29ff329 (diff)
crypto: mediatek - 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 'drivers/crypto/mediatek')
-rw-r--r--drivers/crypto/mediatek/mtk-sha.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c
index bd6309e57ab8..da3f0b8814aa 100644
--- a/drivers/crypto/mediatek/mtk-sha.c
+++ b/drivers/crypto/mediatek/mtk-sha.c
@@ -805,12 +805,9 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
size_t ds = crypto_shash_digestsize(bctx->shash);
int err, i;
- SHASH_DESC_ON_STACK(shash, bctx->shash);
-
- shash->tfm = bctx->shash;
-
if (keylen > bs) {
- err = crypto_shash_digest(shash, key, keylen, bctx->ipad);
+ err = crypto_shash_tfm_digest(bctx->shash, key, keylen,
+ bctx->ipad);
if (err)
return err;
keylen = ds;