diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-11-29 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2024-11-30 15:27:15 +0500 |
commit | e5431fa6f5505e385c6f9367260717e9c47dc2ee (patch) | |
tree | 4cd2c2c3b225b48c8e7053432c41d7b6b6a3d5f8 /C/Sha1.h | |
parent | e008ce3976c087bfd21344af8f00a23cf69d4174 (diff) | |
download | 7zip-main.tar.gz 7zip-main.tar.bz2 7zip-main.zip |
Diffstat (limited to '')
-rw-r--r-- | C/Sha1.h | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* Sha1.h -- SHA-1 Hash | 1 | /* Sha1.h -- SHA-1 Hash |
2 | 2023-04-02 : Igor Pavlov : Public domain */ | 2 | : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #ifndef ZIP7_INC_SHA1_H | 4 | #ifndef ZIP7_INC_SHA1_H |
5 | #define ZIP7_INC_SHA1_H | 5 | #define ZIP7_INC_SHA1_H |
@@ -14,6 +14,9 @@ EXTERN_C_BEGIN | |||
14 | #define SHA1_BLOCK_SIZE (SHA1_NUM_BLOCK_WORDS * 4) | 14 | #define SHA1_BLOCK_SIZE (SHA1_NUM_BLOCK_WORDS * 4) |
15 | #define SHA1_DIGEST_SIZE (SHA1_NUM_DIGEST_WORDS * 4) | 15 | #define SHA1_DIGEST_SIZE (SHA1_NUM_DIGEST_WORDS * 4) |
16 | 16 | ||
17 | |||
18 | |||
19 | |||
17 | typedef void (Z7_FASTCALL *SHA1_FUNC_UPDATE_BLOCKS)(UInt32 state[5], const Byte *data, size_t numBlocks); | 20 | typedef void (Z7_FASTCALL *SHA1_FUNC_UPDATE_BLOCKS)(UInt32 state[5], const Byte *data, size_t numBlocks); |
18 | 21 | ||
19 | /* | 22 | /* |
@@ -32,9 +35,16 @@ typedef void (Z7_FASTCALL *SHA1_FUNC_UPDATE_BLOCKS)(UInt32 state[5], const Byte | |||
32 | 35 | ||
33 | typedef struct | 36 | typedef struct |
34 | { | 37 | { |
35 | SHA1_FUNC_UPDATE_BLOCKS func_UpdateBlocks; | 38 | union |
36 | UInt64 count; | 39 | { |
37 | UInt64 _pad_2[2]; | 40 | struct |
41 | { | ||
42 | SHA1_FUNC_UPDATE_BLOCKS func_UpdateBlocks; | ||
43 | UInt64 count; | ||
44 | } vars; | ||
45 | UInt64 _pad_64bit[4]; | ||
46 | void *_pad_align_ptr[2]; | ||
47 | } v; | ||
38 | UInt32 state[SHA1_NUM_DIGEST_WORDS]; | 48 | UInt32 state[SHA1_NUM_DIGEST_WORDS]; |
39 | UInt32 _pad_3[3]; | 49 | UInt32 _pad_3[3]; |
40 | Byte buffer[SHA1_BLOCK_SIZE]; | 50 | Byte buffer[SHA1_BLOCK_SIZE]; |