6af36908432684ed81e58fd26103f0e572b88acf
[citadel.git] / citadel / md5.h
1 /*
2  * $Id$
3  */
4
5 #ifndef MD5_H
6 #define MD5_H
7
8 #include "sysdep.h"
9 #include "typesize.h"
10
11 struct MD5Context {
12         cit_uint32_t buf[4];
13         cit_uint32_t bits[2];
14         cit_uint32_t in[16];
15 };
16
17 void MD5Init(struct MD5Context *context);
18 void MD5Update(struct MD5Context *context, unsigned char const *buf,
19                unsigned len);
20 void MD5Final(unsigned char digest[16], struct MD5Context *context);
21 void MD5Transform(cit_uint32_t buf[4], cit_uint32_t const in[16]);
22 char *make_apop_string(char *realpass, char *nonce, char *buffer, size_t n);
23
24 /*
25  * This is needed to make RSAREF happy on some MS-DOS compilers.
26  */
27 #ifndef HAVE_OPENSSL
28 typedef struct MD5Context MD5_CTX;
29 #endif
30
31 #define MD5_DIGEST_LEN          16
32 #define MD5_HEXSTRING_SIZE      33
33
34 #endif /* !MD5_H */