diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2008-07-07 10:19:53 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-07-10 08:35:18 -0400 |
commit | 20036252fc61c624a49770fb89684ea5cfdfa05e (patch) | |
tree | 29db0f146bab13b399d0df9e80041fc35a64fc91 /include/crypto/internal | |
parent | b8454eebe380677789735fd6bad368af2e6b2d1e (diff) |
crypto: hash - Added scatter list walking helper
This patch adds the walking helpers for hash algorithms akin to
those of block ciphers. This is a necessary step before we can
reimplement existing hash algorithms using the new ahash interface.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal')
-rw-r--r-- | include/crypto/internal/hash.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h new file mode 100644 index 000000000000..93ac42280221 --- /dev/null +++ b/include/crypto/internal/hash.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Hash algorithms. | ||
3 | * | ||
4 | * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the Free | ||
8 | * Software Foundation; either version 2 of the License, or (at your option) | ||
9 | * any later version. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | #ifndef _CRYPTO_INTERNAL_HASH_H | ||
14 | #define _CRYPTO_INTERNAL_HASH_H | ||
15 | |||
16 | #include <crypto/algapi.h> | ||
17 | |||
18 | struct ahash_request; | ||
19 | struct scatterlist; | ||
20 | |||
21 | struct crypto_hash_walk { | ||
22 | char *data; | ||
23 | |||
24 | unsigned int offset; | ||
25 | unsigned int alignmask; | ||
26 | |||
27 | struct page *pg; | ||
28 | unsigned int entrylen; | ||
29 | |||
30 | unsigned int total; | ||
31 | struct scatterlist *sg; | ||
32 | |||
33 | unsigned int flags; | ||
34 | }; | ||
35 | |||
36 | int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); | ||
37 | int crypto_hash_walk_first(struct ahash_request *req, | ||
38 | struct crypto_hash_walk *walk); | ||
39 | |||
40 | #endif /* _CRYPTO_INTERNAL_HASH_H */ | ||
41 | |||