]> git.sur5r.net Git - openldap/blob - include/lutil_hash.h
Happy New Year
[openldap] / include / lutil_hash.h
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1998-2018 The OpenLDAP Foundation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.
10  *
11  * A copy of this license is available in file LICENSE in the
12  * top-level directory of the distribution or, alternatively, at
13  * <http://www.OpenLDAP.org/license.html>.
14  */
15
16 #ifndef _LUTIL_HASH_H_
17 #define _LUTIL_HASH_H_
18
19 #include <lber_types.h>
20
21 LDAP_BEGIN_DECL
22
23 #define LUTIL_HASH_BYTES 4
24
25 struct lutil_HASHContext {
26         ber_uint_t hash;
27 };
28
29 LDAP_LUTIL_F( void )
30 lutil_HASHInit LDAP_P((
31         struct lutil_HASHContext *context));
32
33 LDAP_LUTIL_F( void )
34 lutil_HASHUpdate LDAP_P((
35         struct lutil_HASHContext *context,
36         unsigned char const *buf,
37         ber_len_t len));
38
39 LDAP_LUTIL_F( void )
40 lutil_HASHFinal LDAP_P((
41         unsigned char digest[LUTIL_HASH_BYTES],
42         struct lutil_HASHContext *context));
43
44 typedef struct lutil_HASHContext lutil_HASH_CTX;
45
46 LDAP_END_DECL
47
48 #endif /* _LUTIL_HASH_H_ */