5 * @todo Eliminate, use rpmio version instead.
10 typedef unsigned int uint32;
23 * This is needed to make RSAREF happy on some MS-DOS compilers.
25 typedef /*@abstract@*/ struct MD5Context MD5_CTX;
32 * Initialize MD5 hash.
33 * Set bit count to 0 and buffer to mysterious initialization constants.
34 * @param context MD5 private data
35 * @param brokenEndian calculate broken MD5 sum?
37 void rpmMD5Init( /*@out@*/ struct MD5Context *context, int brokenEndian);
40 * Update context to reflect the concatenation of another buffer full
42 * @param context MD5 private data
43 * @param data next data buffer
44 * @param len no. bytes of data
46 void rpmMD5Update(struct MD5Context *context, unsigned char const *buf,
49 * Return MD5 digest, and reset context.
51 * @param context MD5 private data
53 void rpmMD5Final(unsigned char digest[16], struct MD5Context *context);
56 * The core of the MD5 algorithm.
57 * This alters an existing MD5 hash to reflect the addition of 16 longwords
59 * @param buf current MD5 variables
60 * @param in next block of data to add
62 void rpmMD5Transform(uint32 buf[4], uint32 const in[16]);
65 * Return MD5 sum of file as ASCII string.
67 * @retval digest MD5 digest
68 * @return 0 on success, 1 on error
70 int mdfile(const char *fn, unsigned char *digest);
73 * Return MD5 sum of file as binary data.
75 * @retval bindigest MD5 digest
76 * @return 0 on success, 1 on error
78 int mdbinfile(const char *fn, unsigned char *bindigest);
80 /* These assume a little endian machine and return incorrect results!
81 They are here for compatibility with old (broken) versions of RPM */
84 * Return (broken!) MD5 sum of file as ASCII string.
85 * @deprecated Here for compatibility with old (broken) versions of RPM.
87 * @retval digest MD5 digest
88 * @return 0 on success, 1 on error
90 int mdfileBroken(const char *fn, unsigned char *digest);
93 * Return (broken!) MD5 sum of file as binary data.
94 * @deprecated Here for compatibility with old (broken) versions of RPM.
96 * @retval bindigest MD5 digest
97 * @return 0 on success, 1 on error
99 int mdbinfileBroken(const char *fn, unsigned char *bindigest);