Commit b00ba76a authored by Herbert Xu's avatar Herbert Xu

crypto: ahash - Add ahash_alg_instance

This patch adds the helper ahash_alg_instance which is used to
convert a crypto_ahash object into its corresponding ahash_instance.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e73d340d
...@@ -164,6 +164,12 @@ static inline struct ahash_instance *ahash_instance( ...@@ -164,6 +164,12 @@ static inline struct ahash_instance *ahash_instance(
return container_of(inst, struct ahash_instance, s.base); return container_of(inst, struct ahash_instance, s.base);
} }
static inline struct ahash_instance *ahash_alg_instance(
struct crypto_ahash *ahash)
{
return ahash_instance(crypto_tfm_alg_instance(&ahash->base));
}
static inline void *ahash_instance_ctx(struct ahash_instance *inst) static inline void *ahash_instance_ctx(struct ahash_instance *inst)
{ {
return crypto_instance_ctx(ahash_crypto_instance(inst)); return crypto_instance_ctx(ahash_crypto_instance(inst));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment