summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-07-07 16:19:53 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2008-07-10 14:35:18 +0200
commit20036252fc61c624a49770fb89684ea5cfdfa05e (patch)
tree29db0f146bab13b399d0df9e80041fc35a64fc91 /include
parentcrypto: prng - Deterministic CPRNG (diff)
downloadlinux-20036252fc61c624a49770fb89684ea5cfdfa05e.tar.xz
linux-20036252fc61c624a49770fb89684ea5cfdfa05e.zip
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')
-rw-r--r--include/crypto/internal/hash.h41
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 @@
+/*
+ * Hash algorithms.
+ *
+ * Copyright (c) 2008 Herbert Xu <herbert@gondor.apana.org.au>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ */
+
+#ifndef _CRYPTO_INTERNAL_HASH_H
+#define _CRYPTO_INTERNAL_HASH_H
+
+#include <crypto/algapi.h>
+
+struct ahash_request;
+struct scatterlist;
+
+struct crypto_hash_walk {
+ char *data;
+
+ unsigned int offset;
+ unsigned int alignmask;
+
+ struct page *pg;
+ unsigned int entrylen;
+
+ unsigned int total;
+ struct scatterlist *sg;
+
+ unsigned int flags;
+};
+
+int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err);
+int crypto_hash_walk_first(struct ahash_request *req,
+ struct crypto_hash_walk *walk);
+
+#endif /* _CRYPTO_INTERNAL_HASH_H */
+