Commit 0390e6aecf571ddac934e6c0644bb4038167b698

Authored by Herbert Xu
1 parent cde6263fa9

crypto: shash - Add __crypto_shash_cast

This patch adds __crypto_shash_cast which turns a crypto_tfm
into crypto_shash.  It's analogous to the other __crypto_*_cast
functions.

It hasn't been needed until now since no existing shash algorithms
have had an init function.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

include/crypto/internal/hash.h
... ... @@ -128,5 +128,10 @@
128 128 return crypto_tfm_ctx_aligned(&tfm->base);
129 129 }
130 130  
  131 +static inline struct crypto_shash *__crypto_shash_cast(struct crypto_tfm *tfm)
  132 +{
  133 + return (struct crypto_shash *)tfm;
  134 +}
  135 +
131 136 #endif /* _CRYPTO_INTERNAL_HASH_H */