aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto/algapi.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-08-30 03:36:14 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:39 -0400
commit1ae978208e2ee9ba1b01d309164bc5e590cd242d (patch)
tree89dac5bceddd383836de9a4da6cc7d381f374e3f /include/crypto/algapi.h
parente2ee95b8c69e542d6afef3f6f38ea598cc146ba7 (diff)
[CRYPTO] api: Add aead crypto type
This patch adds crypto_aead which is the interface for AEAD (Authenticated Encryption with Associated Data) algorithms. AEAD algorithms perform authentication and encryption in one step. Traditionally users (such as IPsec) would use two different crypto algorithms to perform these. With AEAD this comes down to one algorithm and one operation. Of course if traditional algorithms were used we'd still be doing two operations underneath. However, real AEAD algorithms may allow the underlying operations to be optimised as well. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/algapi.h')
-rw-r--r--include/crypto/algapi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 8081294e4328..290bce0c5bd5 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -94,6 +94,7 @@ struct blkcipher_walk {
94}; 94};
95 95
96extern const struct crypto_type crypto_ablkcipher_type; 96extern const struct crypto_type crypto_ablkcipher_type;
97extern const struct crypto_type crypto_aead_type;
97extern const struct crypto_type crypto_blkcipher_type; 98extern const struct crypto_type crypto_blkcipher_type;
98extern const struct crypto_type crypto_hash_type; 99extern const struct crypto_type crypto_hash_type;
99 100
@@ -165,6 +166,11 @@ static inline void *crypto_ablkcipher_ctx_aligned(struct crypto_ablkcipher *tfm)
165 return crypto_tfm_ctx_aligned(&tfm->base); 166 return crypto_tfm_ctx_aligned(&tfm->base);
166} 167}
167 168
169static inline struct aead_alg *crypto_aead_alg(struct crypto_aead *tfm)
170{
171 return &crypto_aead_tfm(tfm)->__crt_alg->cra_aead;
172}
173
168static inline struct crypto_blkcipher *crypto_spawn_blkcipher( 174static inline struct crypto_blkcipher *crypto_spawn_blkcipher(
169 struct crypto_spawn *spawn) 175 struct crypto_spawn *spawn)
170{ 176{