]> git.sur5r.net Git - openldap/blob - include/lutil_md5.h
Round one of LDAP_F() macro changes. In this round we rename
[openldap] / include / lutil_md5.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted only
7  * as authorized by the OpenLDAP Public License.  A copy of this
8  * license is available at http://www.OpenLDAP.org/license.html or
9  * in file LICENSE in the top-level directory of the distribution.
10  */
11
12 /* See md5.c for explanation and copyright information.  */
13
14 #ifndef _LUTIL_MD5_H_
15 #define _LUTIL_MD5_H_
16
17 #include <lber_types.h>
18
19 LDAP_BEGIN_DECL
20
21 /* Unlike previous versions of this code, ber_int_t need not be exactly
22    32 bits, merely 32 bits or more.  Choosing a data type which is 32
23    bits instead of 64 is not important; speed is considerably more
24    important.  ANSI guarantees that "unsigned long" will be big enough,
25    and always using it seems to have few disadvantages.  */
26
27 #define LUTIL_MD5_BYTES 16
28
29 struct lutil_MD5Context {
30         ber_uint_t buf[4];
31         ber_uint_t bits[2];
32         unsigned char in[64];
33 };
34
35 LDAP_LUTIL_F( void )
36 lutil_MD5Init LDAP_P((
37         struct lutil_MD5Context *context));
38
39 LDAP_LUTIL_F( void )
40 lutil_MD5Update LDAP_P((
41         struct lutil_MD5Context *context,
42         unsigned char const *buf,
43         ber_len_t len));
44
45 LDAP_LUTIL_F( void )
46 lutil_MD5Final LDAP_P((
47         unsigned char digest[16],
48         struct lutil_MD5Context *context));
49
50 LDAP_LUTIL_F( void )
51 lutil_MD5Transform LDAP_P((
52         ber_uint_t buf[4],
53         const unsigned char in[64]));
54
55 /*
56  * This is needed to make RSAREF happy on some MS-DOS compilers.
57  */
58 typedef struct lutil_MD5Context lutil_MD5_CTX;
59
60 LDAP_END_DECL
61
62 #endif /* _LUTIL_MD5_H_ */