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/Md5.h | |
parent | e008ce3976c087bfd21344af8f00a23cf69d4174 (diff) | |
download | 7zip-main.tar.gz 7zip-main.tar.bz2 7zip-main.zip |
Diffstat (limited to 'C/Md5.h')
-rw-r--r-- | C/Md5.h | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -0,0 +1,34 @@ | |||
1 | /* Md5.h -- MD5 Hash | ||
2 | : Igor Pavlov : Public domain */ | ||
3 | |||
4 | #ifndef ZIP7_INC_MD5_H | ||
5 | #define ZIP7_INC_MD5_H | ||
6 | |||
7 | #include "7zTypes.h" | ||
8 | |||
9 | EXTERN_C_BEGIN | ||
10 | |||
11 | #define MD5_NUM_BLOCK_WORDS 16 | ||
12 | #define MD5_NUM_DIGEST_WORDS 4 | ||
13 | |||
14 | #define MD5_BLOCK_SIZE (MD5_NUM_BLOCK_WORDS * 4) | ||
15 | #define MD5_DIGEST_SIZE (MD5_NUM_DIGEST_WORDS * 4) | ||
16 | |||
17 | typedef struct | ||
18 | { | ||
19 | UInt64 count; | ||
20 | UInt64 _pad_1; | ||
21 | // we want 16-bytes alignment here | ||
22 | UInt32 state[MD5_NUM_DIGEST_WORDS]; | ||
23 | UInt64 _pad_2[4]; | ||
24 | // we want 64-bytes alignment here | ||
25 | Byte buffer[MD5_BLOCK_SIZE]; | ||
26 | } CMd5; | ||
27 | |||
28 | void Md5_Init(CMd5 *p); | ||
29 | void Md5_Update(CMd5 *p, const Byte *data, size_t size); | ||
30 | void Md5_Final(CMd5 *p, Byte *digest); | ||
31 | |||
32 | EXTERN_C_END | ||
33 | |||
34 | #endif | ||