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

crypto: ccree - 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: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
8cbb8097 f32b6775

+3 -6
+3 -6
drivers/crypto/ccree/cc_cipher.c
··· 427 427 int key_len = keylen >> 1; 428 428 int err; 429 429 430 - SHASH_DESC_ON_STACK(desc, ctx_p->shash_tfm); 431 - 432 - desc->tfm = ctx_p->shash_tfm; 433 - 434 - err = crypto_shash_digest(desc, ctx_p->user.key, key_len, 435 - ctx_p->user.key + key_len); 430 + err = crypto_shash_tfm_digest(ctx_p->shash_tfm, 431 + ctx_p->user.key, key_len, 432 + ctx_p->user.key + key_len); 436 433 if (err) { 437 434 dev_err(dev, "Failed to hash ESSIV key.\n"); 438 435 return err;