]> jfr.im git - irc/quakenet/snircd.git/blob - include/ircd_md5.h
Initial import of 2.10.12.01
[irc/quakenet/snircd.git] / include / ircd_md5.h
1 /*
2 * IRC - Internet Relay Chat, include/ircd_md5.h
3 *
4 * This code implements the MD5 message-digest algorithm.
5 * The algorithm is due to Ron Rivest. This code was
6 * written by Colin Plumb in 1993, no copyright is claimed.
7 * This code is in the public domain; do with it what you wish.
8 *
9 * Equivalent code is available from RSA Data Security, Inc.
10 * This code has been tested against that, and is equivalent,
11 * except that you don't need to include two pages of legalese
12 * with every copy.
13 *
14 * ircuified 2002 by hikari
15 */
16 /** @file
17 * @brief MD5 implementation for ircu.
18 * @version $Id: ircd_md5.h,v 1.3 2004/10/05 22:51:46 entrope Exp $
19 */
20 #ifndef ircd_md5_h
21 #define ircd_md5_h
22
23 /** Typedef for an unsigned 32-bit integer. */
24 typedef unsigned int uint32;
25
26 /** MD5 context structure. */
27 struct MD5Context {
28 uint32 buf[4]; /**< Current digest state/value. */
29 uint32 bits[2]; /**< Number of bits hashed so far. */
30 unsigned char in[64]; /**< Residual input buffer. */
31 };
32
33 void MD5Init(struct MD5Context *);
34 void MD5Update(struct MD5Context *, unsigned const char *, unsigned);
35 void MD5Final(unsigned char digest[16], struct MD5Context *);
36 void MD5Transform(uint32 buf[4], uint32 const in[16]);
37
38 char *crypt_md5(const char *pw, const char *salt);
39
40 /** Helper typedef for the MD5 context structure. */
41 typedef struct MD5Context MD5_CTX;
42
43 #endif /* ircd_md5_h */