diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-15 00:40:40 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-07-15 00:40:40 -0400 |
commit | 66f6ce5e52f2f209d5bf1f06167cec888f4f4c13 (patch) | |
tree | aa7b21af00649d2f458b72ebfba071816cb340c3 /include/crypto/internal | |
parent | 093900c2b964da73daf234374225b5ce5d49f941 (diff) |
crypto: ahash - Add unaligned handling and default operations
This patch exports the finup operation where available and adds
a default finup operation for ahash. The operations final, finup
and digest also will now deal with unaligned result pointers by
copying it. Finally export/import operations are will now be
exported too.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal')
-rw-r--r-- | include/crypto/internal/hash.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 179dd8fdfa14..5bfad8c80595 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h | |||
@@ -59,6 +59,11 @@ int crypto_hash_walk_first_compat(struct hash_desc *hdesc, | |||
59 | struct crypto_hash_walk *walk, | 59 | struct crypto_hash_walk *walk, |
60 | struct scatterlist *sg, unsigned int len); | 60 | struct scatterlist *sg, unsigned int len); |
61 | 61 | ||
62 | static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk) | ||
63 | { | ||
64 | return !(walk->entrylen | walk->total); | ||
65 | } | ||
66 | |||
62 | int crypto_register_ahash(struct ahash_alg *alg); | 67 | int crypto_register_ahash(struct ahash_alg *alg); |
63 | int crypto_unregister_ahash(struct ahash_alg *alg); | 68 | int crypto_unregister_ahash(struct ahash_alg *alg); |
64 | int ahash_register_instance(struct crypto_template *tmpl, | 69 | int ahash_register_instance(struct crypto_template *tmpl, |
@@ -94,6 +99,7 @@ static inline void crypto_drop_shash(struct crypto_shash_spawn *spawn) | |||
94 | struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask); | 99 | struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask); |
95 | 100 | ||
96 | int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc); | 101 | int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc); |
102 | int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc); | ||
97 | int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc); | 103 | int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc); |
98 | 104 | ||
99 | int crypto_init_shash_ops_async(struct crypto_tfm *tfm); | 105 | int crypto_init_shash_ops_async(struct crypto_tfm *tfm); |