Skip to content

Commit e0077ea

Browse files
ebiggersherbertx
authored andcommitted
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>
1 parent 61c38e3 commit e0077ea

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎drivers/crypto/mediatek/mtk-sha.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -805,12 +805,9 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
805805
size_t ds = crypto_shash_digestsize(bctx->shash);
806806
int err, i;
807807

808-
SHASH_DESC_ON_STACK(shash, bctx->shash);
809-
810-
shash->tfm = bctx->shash;
811-
812808
if (keylen > bs) {
813-
err = crypto_shash_digest(shash, key, keylen, bctx->ipad);
809+
err = crypto_shash_tfm_digest(bctx->shash, key, keylen,
810+
bctx->ipad);
814811
if (err)
815812
return err;
816813
keylen = ds;

0 commit comments

Comments
 (0)