From d9e1670b8005999998b557c0e301bb68192bb1c8 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 8 Dec 2019 13:42:53 +0800 Subject: crypto: hmac - Use init_tfm/exit_tfm interface This patch switches hmac over to the new init_tfm/exit_tfm interface as opposed to cra_init/cra_exit. This way the shash API can make sure that descsize does not exceed the maximum. This patch also adds the API helper shash_alg_instance. Signed-off-by: Herbert Xu Reviewed-by: Eric Biggers Signed-off-by: Herbert Xu --- include/crypto/internal/hash.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/crypto') diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index f68dab38f160..cf8d7f99c93d 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h @@ -220,6 +220,12 @@ static inline struct shash_instance *shash_instance( struct shash_instance, alg); } +static inline struct shash_instance *shash_alg_instance( + struct crypto_shash *shash) +{ + return shash_instance(crypto_tfm_alg_instance(&shash->base)); +} + static inline void *shash_instance_ctx(struct shash_instance *inst) { return crypto_instance_ctx(shash_crypto_instance(inst)); -- cgit v1.2.3