Apply hikari's pluggable crypt mechanism patch
[ircu2.10.12-pk.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  * $Id$
17 */
18 #ifndef ircd_md5_h
19 #define ircd_md5_h
20
21 #define MD5Name(x) Good##x
22
23 typedef unsigned int uint32;
24
25 struct MD5Context {
26         uint32 buf[4];
27         uint32 bits[2];
28         unsigned char in[64];
29 };
30
31 void GoodMD5Init(struct MD5Context *);
32 void GoodMD5Update(struct MD5Context *, unsigned const char *, unsigned);
33 void GoodMD5Final(unsigned char digest[16], struct MD5Context *);
34 void GoodMD5Transform(uint32 buf[4], uint32 const in[16]);
35 void BrokenMD5Init(struct MD5Context *);
36 void BrokenMD5Update(struct MD5Context *, unsigned const char *, unsigned);
37 void BrokenMD5Final(unsigned char digest[16], struct MD5Context *);
38 void BrokenMD5Transform(uint32 buf[4], uint32 const in[16]);
39
40 char *Goodcrypt_md5(const char *pw, const char *salt);
41 char *Brokencrypt_md5(const char *pw, const char *salt);
42
43 /*
44  * This is needed to make RSAREF happy on some MS-DOS compilers.
45  */
46
47 typedef struct MD5Context MD5_CTX;
48
49 #endif /* ircd_md5_h */