summaryrefslogtreecommitdiff
path: root/include/crypto/sha2.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-04-28 12:56:05 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 13:32:01 +0800
commit74a43a2cf5e8a3eeab3b55a2e64b33281f5ac554 (patch)
treef547dd09feed355e483558b6f8e8c4c01e3d9266 /include/crypto/sha2.h
parentfba4aafaba8a6ca2bb42e854c37ff9a685ddfd71 (diff)
downloadlinux-next-74a43a2cf5e8a3eeab3b55a2e64b33281f5ac554.tar.gz
linux-next-74a43a2cf5e8a3eeab3b55a2e64b33281f5ac554.zip
crypto: lib/sha256 - Move partial block handling out
Extract the common partial block handling into a helper macro that can be reused by other library code. Also delete the unused sha256_base_do_finalize function. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/sha2.h')
-rw-r--r--include/crypto/sha2.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/crypto/sha2.h b/include/crypto/sha2.h
index abbd882f7849..f873c2207b1e 100644
--- a/include/crypto/sha2.h
+++ b/include/crypto/sha2.h
@@ -71,8 +71,13 @@ struct crypto_sha256_state {
};
struct sha256_state {
- u32 state[SHA256_DIGEST_SIZE / 4];
- u64 count;
+ union {
+ struct crypto_sha256_state ctx;
+ struct {
+ u32 state[SHA256_DIGEST_SIZE / 4];
+ u64 count;
+ };
+ };
u8 buf[SHA256_BLOCK_SIZE];
};