From: Herbert Xu Date: Thu, 28 May 2015 14:07:55 +0000 (+0800) Subject: crypto: aead - Add aead_alg_instance X-Git-Tag: v5.15~15621^2~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c98d62059faf7c59211cb591da671eaac7b7c3c;p=platform%2Fkernel%2Flinux-starfive.git crypto: aead - Add aead_alg_instance Now that type-safe init/exit functions exist, they often need to access the underlying aead_instance. So this patch adds the helper aead_alg_instance to access aead_instance from a crypto_aead object. Signed-off-by: Herbert Xu --- diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h index 4137330..f068d74 100644 --- a/include/crypto/internal/aead.h +++ b/include/crypto/internal/aead.h @@ -52,6 +52,11 @@ static inline struct aead_instance *aead_instance(struct crypto_instance *inst) return container_of(&inst->alg, struct aead_instance, alg.base); } +static inline struct aead_instance *aead_alg_instance(struct crypto_aead *aead) +{ + return aead_instance(crypto_aead_alg_instance(aead)); +} + static inline void *aead_instance_ctx(struct aead_instance *inst) { return crypto_instance_ctx(aead_crypto_instance(inst));