2 * This code implements the MD5 message-digest algorithm.
3 * The algorithm is due to Ron Rivest. This code was
4 * written by Colin Plumb in 1993, no copyright is claimed.
5 * This code is in the public domain; do with it what you wish.
7 * Equivalent code is available from RSA Data Security, Inc.
8 * This code has been tested against that, and is equivalent,
9 * except that you don't need to include two pages of legalese
12 * To compute the message digest of a chunk of bytes, declare an
13 * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as
14 * needed on buffers full of bytes, and then call rpmMD5Final, which
15 * will fill a supplied 16-byte array with the digest.
18 /* parts of this file are :
19 * Written March 1993 by Branko Lankester
20 * Modified June 1993 by Colin Plumb for altered md5.c.
21 * Modified October 1995 by Erik Troan for RPM
31 typedef struct _MD5Context {
40 void md5_init(MD5Context *ctx);
41 void md5_update(MD5Context *ctx, const guchar *buf, guint32 len);
42 void md5_final(MD5Context *ctx, guchar digest[16]);
44 /* generate digest from memory buffer */
45 void md5_get_digest(const guchar *buffer, gint buffer_size, guchar digest[16]);
47 /* generate digest from file */
48 gboolean md5_get_digest_from_file(const gchar *path, guchar digest[16]);
50 /* convert digest to/from a NULL terminated text string, in ascii encoding */
51 gchar *md5_digest_to_text(guchar digest[16]);
52 gboolean md5_digest_from_text(const gchar *text, guchar digest[16]);
55 #endif /* MD5_UTILS_H */
56 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */