6 * @todo Eliminate, use rpmio version instead.
11 typedef unsigned int uint32;
24 * This is needed to make RSAREF happy on some MS-DOS compilers.
26 typedef /*@abstract@*/ struct MD5Context MD5_CTX;
33 * Initialize MD5 hash.
34 * Set bit count to 0 and buffer to mysterious initialization constants.
35 * @param context MD5 private data
36 * @param brokenEndian calculate broken MD5 sum?
38 void rpmMD5Init( /*@out@*/ struct MD5Context *context, int brokenEndian);
41 * Update context to reflect the concatenation of another buffer full
43 * @param context MD5 private data
44 * @param data next data buffer
45 * @param len no. bytes of data
47 void rpmMD5Update(struct MD5Context *context, unsigned char const *buf,
50 * Return MD5 digest, and reset context.
52 * @param context MD5 private data
54 void rpmMD5Final(unsigned char digest[16], struct MD5Context *context);
57 * The core of the MD5 algorithm.
58 * This alters an existing MD5 hash to reflect the addition of 16 longwords
60 * @param buf current MD5 variables
61 * @param in next block of data to add
63 void rpmMD5Transform(uint32 buf[4], uint32 const in[16]);
66 * Return MD5 sum of file as ASCII string.
68 * @retval digest MD5 digest
69 * @return 0 on success, 1 on error
71 int mdfile(const char *fn, unsigned char *digest);
74 * Return MD5 sum of file as binary data.
76 * @retval bindigest MD5 digest
77 * @return 0 on success, 1 on error
79 int mdbinfile(const char *fn, unsigned char *bindigest);
81 /* These assume a little endian machine and return incorrect results!
82 They are here for compatibility with old (broken) versions of RPM */
85 * Return (broken!) MD5 sum of file as ASCII string.
86 * @deprecated Here for compatibility with old (broken) versions of RPM.
88 * @retval digest MD5 digest
89 * @return 0 on success, 1 on error
91 int mdfileBroken(const char *fn, unsigned char *digest);
94 * Return (broken!) MD5 sum of file as binary data.
95 * @deprecated Here for compatibility with old (broken) versions of RPM.
97 * @retval bindigest MD5 digest
98 * @return 0 on success, 1 on error
100 int mdbinfileBroken(const char *fn, unsigned char *bindigest);