summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-05-28 22:07:55 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-06-03 10:48:33 +0800
commit5c98d62059faf7c59211cb591da671eaac7b7c3c (patch)
treec94056ed55601412f1e39e6639284a4a8c965f0e /include
parent5eb8ec6dc857d5027bc8cf7268a199107a583ae5 (diff)
downloadlinux-5c98d62059faf7c59211cb591da671eaac7b7c3c.tar.bz2
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 <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')
-rw-r--r--include/crypto/internal/aead.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/crypto/internal/aead.h b/include/crypto/internal/aead.h
index 4137330f01ab..f068d74da9f6 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));