]> git.sur5r.net Git - openldap/blob - include/lutil_md5.h
Added support for password prompting. (-W switch)
[openldap] / include / lutil_md5.h
1 /* See md5.c for explanation and copyright information.  */
2
3 #ifndef _LUTIL_MD5_H_
4 #define _LUTIL_MD5_H_
5
6 #include <ldap_cdefs.h>
7 #include <ac/bytes.h>
8
9 LDAP_BEGIN_DECL
10
11 /* Unlike previous versions of this code, uint32 need not be exactly
12    32 bits, merely 32 bits or more.  Choosing a data type which is 32
13    bits instead of 64 is not important; speed is considerably more
14    important.  ANSI guarantees that "unsigned long" will be big enough,
15    and always using it seems to have few disadvantages.  */
16
17 #ifndef LDAP_UINT32
18 #define LDAP_UINT32 1
19 typedef LDAP_UINT4 uint32;
20 #endif
21
22 struct lutil_MD5Context {
23         uint32 buf[4];
24         uint32 bits[2];
25         unsigned char in[64];
26 };
27
28 LDAP_F void lutil_MD5Init LDAP_P((
29         struct lutil_MD5Context *context));
30
31 LDAP_F void lutil_MD5Update LDAP_P((
32         struct lutil_MD5Context *context,
33         unsigned char const *buf,
34         unsigned len));
35
36 LDAP_F void lutil_MD5Final LDAP_P((
37         unsigned char digest[16],
38         struct lutil_MD5Context *context));
39
40 LDAP_F void lutil_MD5Transform LDAP_P((
41         uint32 buf[4],
42         const unsigned char in[64]));
43
44 /*
45  * This is needed to make RSAREF happy on some MS-DOS compilers.
46  */
47 typedef struct lutil_MD5Context lutil_MD5_CTX;
48
49 LDAP_END_DECL
50
51 #endif /* _LUTIL_MD5_H_ */