2 * MD5 hashing code copied from Lepton's crack <http://usuarios.lycos.es/reinob/>
4 * Adapted to be API-compatible with the previous (GPL-incompatible) code.
8 * This code implements the MD5 message-digest algorithm.
9 * The algorithm is due to Ron Rivest. This code was
10 * written by Colin Plumb in 1993, no copyright is claimed.
11 * This code is in the public domain; do with it what you wish.
13 * Equivalent code is available from RSA Data Security, Inc.
14 * This code has been tested against that, and is equivalent,
15 * except that you don't need to include two pages of legalese
18 * To compute the message digest of a chunk of bytes, declare an
19 * MD5Context structure, pass it to MD5Init, call MD5Update as
20 * needed on buffers full of bytes, and then call MD5Final, which
21 * will fill a supplied 16-byte array with the digest.
27 #include <sys/types.h>
35 typedef uint8_t md5_byte_t
;
36 typedef struct MD5Context
{
42 G_MODULE_EXPORT
void md5_init(struct MD5Context
*context
);
43 G_MODULE_EXPORT
void md5_append(struct MD5Context
*context
, const md5_byte_t
*buf
, unsigned int len
);
44 G_MODULE_EXPORT
void md5_finish(struct MD5Context
*context
, md5_byte_t digest
[16]);
45 G_MODULE_EXPORT
void md5_finish_ascii(struct MD5Context
*context
, char *ascii
);