crypto: hash - introduce crypto_hash_alg_has_setkey()
authorEric Biggers <ebiggers@google.com>
Wed, 3 Jan 2018 19:16:22 +0000 (11:16 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:07 +0000 (00:30 +0100)
commit74ea91baca141381b1960721832ff21392f770c4
tree486b2dea42ee457056bb1f69b219f08807ddc754
parentefe80592cd0d721b786e6b6c2b3de25bdd5f6bdf
crypto: hash - introduce crypto_hash_alg_has_setkey()

commit cd6ed77ad5d223dc6299fb58f62e0f5267f7e2ba upstream.

Templates that use an shash spawn can use crypto_shash_alg_has_setkey()
to determine whether the underlying algorithm requires a key or not.
But there was no corresponding function for ahash spawns.  Add it.

Note that the new function actually has to support both shash and ahash
algorithms, since the ahash API can be used with either.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
crypto/ahash.c
include/crypto/internal/hash.h