summaryrefslogtreecommitdiff
path: root/include/crypto/sha.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-04-09 13:55:33 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2015-04-10 16:39:39 +0300
commitc4d5b9ffa31f7283b34cba991514dacae4c8d3de (patch)
tree6ad1da41a7bbb9eef225fe9f76a3039872db4d36 /include/crypto/sha.h
parent9c521a200bc3c12bd724e48a75c57d5358f672be (diff)
downloadlinux-c4d5b9ffa31f7283b34cba991514dacae4c8d3de.tar.xz
crypto: sha1 - implement base layer for SHA-1
To reduce the number of copies of boilerplate code throughout the tree, this patch implements generic glue for the SHA-1 algorithm. This allows a specific arch or hardware implementation to only implement the special handling that it needs. The users need to supply an implementation of void (sha1_block_fn)(struct sha1_state *sst, u8 const *src, int blocks) and pass it to the SHA-1 base functions. For easy casting between the prototype above and existing block functions that take a 'u32 state[]' as their first argument, the 'state' member of struct sha1_state is moved to the base of the struct. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/sha.h')
-rw-r--r--include/crypto/sha.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/crypto/sha.h b/include/crypto/sha.h
index 190f8a0e0242..a9aad8e63f43 100644
--- a/include/crypto/sha.h
+++ b/include/crypto/sha.h
@@ -65,8 +65,8 @@
#define SHA512_H7 0x5be0cd19137e2179ULL
struct sha1_state {
- u64 count;
u32 state[SHA1_DIGEST_SIZE / 4];
+ u64 count;
u8 buffer[SHA1_BLOCK_SIZE];
};