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