Skip to content

Commit

Permalink
crypto: shash - Add __crypto_shash_cast
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu committed Jul 8, 2009
1 parent cde6263 commit 0390e6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/crypto/internal/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,10 @@ static inline void *crypto_shash_ctx_aligned(struct crypto_shash *tfm)
return crypto_tfm_ctx_aligned(&tfm->base);
}

static inline struct crypto_shash *__crypto_shash_cast(struct crypto_tfm *tfm)
{
return (struct crypto_shash *)tfm;
}

#endif /* _CRYPTO_INTERNAL_HASH_H */

0 comments on commit 0390e6a

Please sign in to comment.