diff options
Diffstat (limited to 'include/crypto/sha.h')
-rw-r--r-- | include/crypto/sha.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/crypto/sha.h b/include/crypto/sha.h index 190f8a0e02..e23d7cb766 100644 --- a/include/crypto/sha.h +++ b/include/crypto/sha.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + /* * Common values for SHA algorithms */ @@ -64,21 +66,25 @@ #define SHA512_H6 0x1f83d9abfb41bd6bULL #define SHA512_H7 0x5be0cd19137e2179ULL +/* + * State must be first member for compatibility with assembly + * code imported from Linux + */ 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]; }; |