crypto: hash - introduce crypto_hash_alg_has_setkey()
authorEric Biggers <ebiggers@google.com>
Wed, 3 Jan 2018 19:16:22 +0000 (11:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:22:59 +0000 (20:22 +0100)
commitb8b32e2e68f0a3dd67edb34710964dc3e67bdf3b
tree982bbbfa01f9082398c3d9bbec0496040585b8ff
parent449704d3ba6f45585da8cc033af2e3178d7344a7
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/ahash.c
include/crypto/internal/hash.h