aboutsummaryrefslogtreecommitdiffstats
path: root/camel/md5-utils.h
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-09-06 06:46:58 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-06 06:46:58 +0800
commit2110ea101f673c11db212ebc3d4d238f74c19fee (patch)
tree0223bf67af65491d1880ff28ec393cabd96cecec /camel/md5-utils.h
parent116b88eb5d75445872130fc253bfa97d6be08d77 (diff)
downloadgsoc2013-evolution-2110ea101f673c11db212ebc3d4d238f74c19fee.tar.gz
gsoc2013-evolution-2110ea101f673c11db212ebc3d4d238f74c19fee.tar.zst
gsoc2013-evolution-2110ea101f673c11db212ebc3d4d238f74c19fee.zip
imported md5 coding routine from rpm. Compiles.
1999-09-06 bertrand <Bertrand.Guiheneuf@aful.org> * camel/md5-utils.c: imported md5 coding routine from rpm. Compiles. svn path=/trunk/; revision=1182
Diffstat (limited to 'camel/md5-utils.h')
-rw-r--r--camel/md5-utils.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/camel/md5-utils.h b/camel/md5-utils.h
new file mode 100644
index 0000000000..cebc073609
--- /dev/null
+++ b/camel/md5-utils.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 rpmMD5Init(struct MD5Context *context, int brokenEndian);
+void rpmMD5Update(struct MD5Context *context, unsigned char const *buf,
+ unsigned len);
+void rpmMD5Final(unsigned char digest[16], struct MD5Context *context);
+void rpmMD5Transform(uint32 buf[4], uint32 const in[16]);
+
+int mdfile(const char *fn, unsigned char *digest);
+int mdbinfile(const 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(const char *fn, unsigned char *digest);
+int mdbinfileBroken(const char *fn, unsigned char *bindigest);
+
+/*
+ * This is needed to make RSAREF happy on some MS-DOS compilers.
+ */
+typedef /*@abstract@*/ struct MD5Context MD5_CTX;
+
+#endif /* MD5_H */