mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
crypto: lib/sha256 - add sha256() function
Add a function sha256() which computes a SHA-256 digest in one step, combining sha256_init() + sha256_update() + sha256_final(). This is similar to how we also have blake2s(). Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
7c323ce076
commit
d2482143eb
2 changed files with 11 additions and 0 deletions
|
|
@ -137,6 +137,7 @@ static inline void sha256_init(struct sha256_state *sctx)
|
|||
}
|
||||
void sha256_update(struct sha256_state *sctx, const u8 *data, unsigned int len);
|
||||
void sha256_final(struct sha256_state *sctx, u8 *out);
|
||||
void sha256(const u8 *data, unsigned int len, u8 *out);
|
||||
|
||||
static inline void sha224_init(struct sha256_state *sctx)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue