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

crypto: arm64/aes-glue - 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>

authored by

Eric Biggers and committed by
Herbert Xu
a221b33b 822a98b8

+1 -3
+1 -3
arch/arm64/crypto/aes-glue.c
··· 158 158 unsigned int key_len) 159 159 { 160 160 struct crypto_aes_essiv_cbc_ctx *ctx = crypto_skcipher_ctx(tfm); 161 - SHASH_DESC_ON_STACK(desc, ctx->hash); 162 161 u8 digest[SHA256_DIGEST_SIZE]; 163 162 int ret; 164 163 ··· 165 166 if (ret) 166 167 return ret; 167 168 168 - desc->tfm = ctx->hash; 169 - crypto_shash_digest(desc, in_key, key_len, digest); 169 + crypto_shash_tfm_digest(ctx->hash, in_key, key_len, digest); 170 170 171 171 return aes_expandkey(&ctx->key2, digest, sizeof(digest)); 172 172 }