ICP  1
md5.h
Go to the documentation of this file.
1 #ifndef MD5_H
2 #define MD5_H
3 
4 #ifdef _WIN32
5 #ifndef SIZEOF_LONG
6 #define SIZEOF_LONG 4
7 #endif
8 #else
9 #include "config.h"
10 #endif
11 
12 #if SIZEOF_LONG==8
13 typedef unsigned int uint32;
14 #elif SIZEOF_LONG==4
15 typedef unsigned long uint32;
16 #else
17 #error undefined: SIZEOF_LONG
18 #endif
19 
20 struct MD5Context {
21  uint32 buf[4];
22  uint32 bits[2];
23  unsigned char in[64];
25 };
26 
27 void MD5Init(struct MD5Context *context, int brokenEndian);
28 void MD5Update(struct MD5Context *context, unsigned char const *buf,
29  unsigned len);
30 void MD5Final(unsigned char digest[16], struct MD5Context *context);
31 void MD5Transform(uint32 buf[4], uint32 const in[16]);
32 
33 int mdfile(char *fn, unsigned char *digest);
34 int mdbinfile(char *fn, unsigned char *bindigest);
35 
36 /* These assume a little endian machine and return incorrect results!
37 They are here for compatibility with old (broken) versions of RPM */
38 int mdfileBroken(char *fn, unsigned char *digest);
39 int mdbinfileBroken(char *fn, unsigned char *bindigest);
40 
41 /*
42 * This is needed to make RSAREF happy on some MS-DOS compilers.
43 */
44 typedef struct MD5Context MD5_CTX;
45 
46 #endif /* !MD5_H */
unsigned char in[64]
Definition: md5.h:23
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
Definition: md5.cpp:79
int mdfile(char *fn, unsigned char *digest)
uint32 buf[4]
Definition: md5.h:21
uint32 bits[2]
Definition: md5.h:22
int mdbinfileBroken(char *fn, unsigned char *bindigest)
int mdfileBroken(char *fn, unsigned char *digest)
void MD5Transform(uint32 buf[4], uint32 const in[16])
Definition: md5.cpp:190
int mdbinfile(char *fn, unsigned char *bindigest)
int doByteReverse
Definition: md5.h:24
void MD5Init(struct MD5Context *ctx, int brokenEndian)
Definition: md5.cpp:53
Definition: md5.h:20
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
Definition: md5.cpp:129