summaryrefslogtreecommitdiff
path: root/src/md5.h
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-03-19 12:36:11 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-03-19 12:36:11 +0000
commitad5b7acc19290ff91e0f42a0de448a26760fcf99 (patch)
tree2d1867758835fd0c4e443ff3cc7e5c774af85874 /src/md5.h
Imported httrack 3.20.2
Diffstat (limited to 'src/md5.h')
-rw-r--r--src/md5.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/md5.h b/src/md5.h
new file mode 100644
index 0000000..f5e5428
--- /dev/null
+++ b/src/md5.h
@@ -0,0 +1,36 @@
+#ifndef MD5_H
+#define MD5_H
+
+#ifdef __alpha
+typedef unsigned int uint32;
+#else
+typedef unsigned long uint32;
+#endif
+
+struct MD5Context {
+ uint32 buf[4];
+ uint32 bits[2];
+ unsigned char in[64];
+ int doByteReverse;
+};
+
+void MD5Init(struct MD5Context *context, int brokenEndian);
+void MD5Update(struct MD5Context *context, unsigned char const *buf,
+ unsigned len);
+void MD5Final(unsigned char digest[16], struct MD5Context *context);
+void MD5Transform(uint32 buf[4], uint32 const in[16]);
+
+int mdfile(char *fn, unsigned char *digest);
+int mdbinfile(char *fn, unsigned char *bindigest);
+
+/* These assume a little endian machine and return incorrect results!
+They are here for compatibility with old (broken) versions of RPM */
+int mdfileBroken(char *fn, unsigned char *digest);
+int mdbinfileBroken(char *fn, unsigned char *bindigest);
+
+/*
+* This is needed to make RSAREF happy on some MS-DOS compilers.
+*/
+typedef struct MD5Context MD5_CTX;
+
+#endif /* !MD5_H */