aboutsummaryrefslogtreecommitdiff
path: root/C/Md5.h
diff options
context:
space:
mode:
Diffstat (limited to 'C/Md5.h')
-rw-r--r--C/Md5.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/C/Md5.h b/C/Md5.h
new file mode 100644
index 0000000..49c0741
--- /dev/null
+++ b/C/Md5.h
@@ -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
9EXTERN_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
17typedef 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
28void Md5_Init(CMd5 *p);
29void Md5_Update(CMd5 *p, const Byte *data, size_t size);
30void Md5_Final(CMd5 *p, Byte *digest);
31
32EXTERN_C_END
33
34#endif