Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: hisilicon/sec2 - 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.

Cc: Zaibo Xu <xuzaibo@huawei.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
61c38e3a 8cbb8097

+2 -3
+2 -3
drivers/crypto/hisilicon/sec2/sec_crypto.c
··· 832 832 struct crypto_authenc_keys *keys) 833 833 { 834 834 struct crypto_shash *hash_tfm = ctx->hash_tfm; 835 - SHASH_DESC_ON_STACK(shash, hash_tfm); 836 835 int blocksize, ret; 837 836 838 837 if (!keys->authkeylen) { ··· 841 842 842 843 blocksize = crypto_shash_blocksize(hash_tfm); 843 844 if (keys->authkeylen > blocksize) { 844 - ret = crypto_shash_digest(shash, keys->authkey, 845 - keys->authkeylen, ctx->a_key); 845 + ret = crypto_shash_tfm_digest(hash_tfm, keys->authkey, 846 + keys->authkeylen, ctx->a_key); 846 847 if (ret) { 847 848 pr_err("hisi_sec2: aead auth digest error!\n"); 848 849 return -EINVAL;