Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lib/md5.h

Go to the documentation of this file.
00001 #ifndef MD5_H
00002 #define MD5_H
00003 
00009 #include <sys/types.h>
00010 
00011 typedef unsigned int uint32;
00012 
00016 struct MD5Context {
00017         uint32 buf[4];
00018         uint32 bits[2];
00019         unsigned char in[64];
00020         int doByteReverse;
00021 };
00022 
00023 /*
00024  * This is needed to make RSAREF happy on some MS-DOS compilers.
00025  */
00026 typedef /*@abstract@*/ struct MD5Context MD5_CTX;
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00038 void rpmMD5Init( /*@out@*/ struct MD5Context *context, int brokenEndian);
00039 
00047 void rpmMD5Update(struct MD5Context *context, unsigned char const *buf,
00048                unsigned len);
00054 void rpmMD5Final(unsigned char digest[16], struct MD5Context *context);
00055 
00063 void rpmMD5Transform(uint32 buf[4], uint32 const in[16]);
00064 
00071 int mdfile(const char *fn, unsigned char *digest);
00072 
00079 int mdbinfile(const char *fn, unsigned char *bindigest);
00080 
00081 /* These assume a little endian machine and return incorrect results!
00082    They are here for compatibility with old (broken) versions of RPM */
00083 
00091 int mdfileBroken(const char *fn, unsigned char *digest);
00092 
00100 int mdbinfileBroken(const char *fn, unsigned char *bindigest);
00101 
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105 
00106 #endif  /* MD5_H */

Generated at Thu Apr 19 15:29:43 2001 for rpm by doxygen1.2.6-20010408 written by Dimitri van Heesch, © 1997-2001