diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-08-31 08:21:09 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-12-24 19:01:33 -0500 |
commit | 5f7082ed4f482f05db01d84dbf58190492ebf0ad (patch) | |
tree | 34ac4dd0811731457dca0f4bcc440fafc93e517b /include | |
parent | 67cd080c5070b4f17520c1385f7684206f4987b3 (diff) |
crypto: hash - Export shash through hash
This patch allows shash algorithms to be used through the old hash
interface. This is a transitional measure so we can convert the
underlying algorithms to shash before converting the users across.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/algapi.h | 5 | ||||
-rw-r--r-- | include/crypto/internal/hash.h | 3 | ||||
-rw-r--r-- | include/linux/crypto.h | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 986db68548f6..010545436efa 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -248,6 +248,11 @@ static inline struct crypto_hash *crypto_spawn_hash(struct crypto_spawn *spawn) | |||
248 | return __crypto_hash_cast(crypto_spawn_tfm(spawn, type, mask)); | 248 | return __crypto_hash_cast(crypto_spawn_tfm(spawn, type, mask)); |
249 | } | 249 | } |
250 | 250 | ||
251 | static inline void *crypto_hash_ctx(struct crypto_hash *tfm) | ||
252 | { | ||
253 | return crypto_tfm_ctx(&tfm->base); | ||
254 | } | ||
255 | |||
251 | static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm) | 256 | static inline void *crypto_hash_ctx_aligned(struct crypto_hash *tfm) |
252 | { | 257 | { |
253 | return crypto_tfm_ctx_aligned(&tfm->base); | 258 | return crypto_tfm_ctx_aligned(&tfm->base); |
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 92fbe7385856..82b70564bcab 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h | |||
@@ -39,6 +39,9 @@ extern const struct crypto_type crypto_ahash_type; | |||
39 | int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); | 39 | int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); |
40 | int crypto_hash_walk_first(struct ahash_request *req, | 40 | int crypto_hash_walk_first(struct ahash_request *req, |
41 | struct crypto_hash_walk *walk); | 41 | struct crypto_hash_walk *walk); |
42 | int crypto_hash_walk_first_compat(struct hash_desc *hdesc, | ||
43 | struct crypto_hash_walk *walk, | ||
44 | struct scatterlist *sg, unsigned int len); | ||
42 | 45 | ||
43 | int crypto_register_shash(struct shash_alg *alg); | 46 | int crypto_register_shash(struct shash_alg *alg); |
44 | int crypto_unregister_shash(struct shash_alg *alg); | 47 | int crypto_unregister_shash(struct shash_alg *alg); |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 77a1f3d9416d..3bacd71509fb 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -36,9 +36,9 @@ | |||
36 | #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 | 36 | #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 |
37 | #define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 | 37 | #define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 |
38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 | 38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 |
39 | #define CRYPTO_ALG_TYPE_HASH 0x00000009 | 39 | #define CRYPTO_ALG_TYPE_HASH 0x00000008 |
40 | #define CRYPTO_ALG_TYPE_SHASH 0x00000009 | ||
40 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a | 41 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a |
41 | #define CRYPTO_ALG_TYPE_SHASH 0x0000000b | ||
42 | #define CRYPTO_ALG_TYPE_RNG 0x0000000c | 42 | #define CRYPTO_ALG_TYPE_RNG 0x0000000c |
43 | 43 | ||
44 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e | 44 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e |