diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-12-05 05:08:36 -0500 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-01-10 16:16:44 -0500 |
| commit | ecfc43292f68566c144afca966b46b371c26d56c (patch) | |
| tree | ef332abe1573434836a90e188257a252ca9f896a /include/crypto/internal/skcipher.h | |
| parent | 927eead52c958829ef62c8aa5da2751033a2cf98 (diff) | |
[CRYPTO] skcipher: Add skcipher_geniv_alloc/skcipher_geniv_free
This patch creates the infrastructure to help the construction of givcipher
templates that wrap around existing blkcipher/ablkcipher algorithms by adding
an IV generator to them.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal/skcipher.h')
| -rw-r--r-- | include/crypto/internal/skcipher.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index c9402dd12d03..07e7c82324ad 100644 --- a/include/crypto/internal/skcipher.h +++ b/include/crypto/internal/skcipher.h | |||
| @@ -15,6 +15,9 @@ | |||
| 15 | 15 | ||
| 16 | #include <crypto/algapi.h> | 16 | #include <crypto/algapi.h> |
| 17 | #include <crypto/skcipher.h> | 17 | #include <crypto/skcipher.h> |
| 18 | #include <linux/types.h> | ||
| 19 | |||
| 20 | struct rtattr; | ||
| 18 | 21 | ||
| 19 | struct crypto_skcipher_spawn { | 22 | struct crypto_skcipher_spawn { |
| 20 | struct crypto_spawn base; | 23 | struct crypto_spawn base; |
| @@ -50,6 +53,21 @@ static inline struct crypto_ablkcipher *crypto_spawn_skcipher( | |||
| 50 | crypto_skcipher_mask(0))); | 53 | crypto_skcipher_mask(0))); |
| 51 | } | 54 | } |
| 52 | 55 | ||
| 56 | const char *crypto_default_geniv(const struct crypto_alg *alg); | ||
| 57 | |||
| 58 | struct crypto_instance *skcipher_geniv_alloc(struct crypto_template *tmpl, | ||
| 59 | struct rtattr **tb, u32 type, | ||
| 60 | u32 mask); | ||
| 61 | void skcipher_geniv_free(struct crypto_instance *inst); | ||
| 62 | int skcipher_geniv_init(struct crypto_tfm *tfm); | ||
| 63 | void skcipher_geniv_exit(struct crypto_tfm *tfm); | ||
| 64 | |||
| 65 | static inline struct crypto_ablkcipher *skcipher_geniv_cipher( | ||
| 66 | struct crypto_ablkcipher *geniv) | ||
| 67 | { | ||
| 68 | return crypto_ablkcipher_crt(geniv)->base; | ||
| 69 | } | ||
| 70 | |||
| 53 | static inline void *skcipher_givcrypt_reqctx( | 71 | static inline void *skcipher_givcrypt_reqctx( |
| 54 | struct skcipher_givcrypt_request *req) | 72 | struct skcipher_givcrypt_request *req) |
| 55 | { | 73 | { |
