[PATCH 6/7] crypto: sha: reorder struct sha*_state into Linux order

Ahmad Fatoum a.fatoum at pengutronix.de
Sun May 21 22:30:43 PDT 2023


Incoming Kernel code expects state to be the first member and uses
variables exported from C to get offsets for the two other members.
To import code as-is from kernel, follow suit. No functional change.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/crypto/sha.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/crypto/sha.h b/include/crypto/sha.h
index 17a489bd4a8d..b01d74cd3334 100644
--- a/include/crypto/sha.h
+++ b/include/crypto/sha.h
@@ -67,20 +67,20 @@
 #define SHA512_H7	0x5be0cd19137e2179ULL
 
 struct sha1_state {
-	u64 count;
 	u32 state[SHA1_DIGEST_SIZE / 4];
+	u64 count;
 	u8 buffer[SHA1_BLOCK_SIZE];
 };
 
 struct sha256_state {
-	u64 count;
 	u32 state[SHA256_DIGEST_SIZE / 4];
+	u64 count;
 	u8 buf[SHA256_BLOCK_SIZE];
 };
 
 struct sha512_state {
-	u64 count[2];
 	u64 state[SHA512_DIGEST_SIZE / 8];
+	u64 count[2];
 	u8 buf[SHA512_BLOCK_SIZE];
 };
 
-- 
2.39.2




More information about the barebox mailing list