Commit e0077ea8 authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

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: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 61c38e3a
...@@ -805,12 +805,9 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, const u8 *key, ...@@ -805,12 +805,9 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
size_t ds = crypto_shash_digestsize(bctx->shash); size_t ds = crypto_shash_digestsize(bctx->shash);
int err, i; int err, i;
SHASH_DESC_ON_STACK(shash, bctx->shash);
shash->tfm = bctx->shash;
if (keylen > bs) { 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) if (err)
return err; return err;
keylen = ds; keylen = ds;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment