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