Skip to content

Commit a221b33

Browse files
ebiggersherbertx
authored andcommitted
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>
1 parent 822a98b commit a221b33

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎arch/arm64/crypto/aes-glue.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,14 @@ static int __maybe_unused essiv_cbc_set_key(struct crypto_skcipher *tfm,
158158
unsigned int key_len)
159159
{
160160
struct crypto_aes_essiv_cbc_ctx *ctx = crypto_skcipher_ctx(tfm);
161-
SHASH_DESC_ON_STACK(desc, ctx->hash);
162161
u8 digest[SHA256_DIGEST_SIZE];
163162
int ret;
164163

165164
ret = aes_expandkey(&ctx->key1, in_key, key_len);
166165
if (ret)
167166
return ret;
168167

169-
desc->tfm = ctx->hash;
170-
crypto_shash_digest(desc, in_key, key_len, digest);
168+
crypto_shash_tfm_digest(ctx->hash, in_key, key_len, digest);
171169

172170
return aes_expandkey(&ctx->key2, digest, sizeof(digest));
173171
}

0 commit comments

Comments
 (0)