diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-04-09 12:55:35 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-04-10 21:39:39 +0800 |
commit | b84a2a0b4ec214fc5d4ba1d3d5b26d4f88733dba (patch) | |
tree | 8bbffc62667996c42660b7582f923284d1fd4ada /include/crypto/sha.h | |
parent | 11b8d5ef91388162103bf28f2e9d6dfd400d192d (diff) | |
download | linux-b84a2a0b4ec214fc5d4ba1d3d5b26d4f88733dba.tar.gz linux-b84a2a0b4ec214fc5d4ba1d3d5b26d4f88733dba.tar.bz2 linux-b84a2a0b4ec214fc5d4ba1d3d5b26d4f88733dba.zip |
crypto: sha512 - implement base layer for SHA-512
To reduce the number of copies of boilerplate code throughout
the tree, this patch implements generic glue for the SHA-512
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 (sha512_block_fn)(struct sha512_state *sst, u8 const *src, int blocks)
and pass it to the SHA-512 base functions. For easy casting between the
prototype above and existing block functions that take a 'u64 state[]'
as their first argument, the 'state' member of struct sha512_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.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/crypto/sha.h b/include/crypto/sha.h index a75bc80cc776..05e82cbc4d8f 100644 --- a/include/crypto/sha.h +++ b/include/crypto/sha.h @@ -77,8 +77,8 @@ struct sha256_state { }; struct sha512_state { - u64 count[2]; u64 state[SHA512_DIGEST_SIZE / 8]; + u64 count[2]; u8 buf[SHA512_BLOCK_SIZE]; }; |