1/* $OpenLDAP$ */
2/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3 *
4 * Copyright 1998-2011 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
21LDAP_BEGIN_DECL
22
23#define LUTIL_HASH_BYTES 4
24
25struct lutil_HASHContext {
26	ber_uint_t hash;
27};
28
29LDAP_LUTIL_F( void )
30lutil_HASHInit LDAP_P((
31	struct lutil_HASHContext *context));
32
33LDAP_LUTIL_F( void )
34lutil_HASHUpdate LDAP_P((
35	struct lutil_HASHContext *context,
36	unsigned char const *buf,
37	ber_len_t len));
38
39LDAP_LUTIL_F( void )
40lutil_HASHFinal LDAP_P((
41	unsigned char digest[LUTIL_HASH_BYTES],
42	struct lutil_HASHContext *context));
43
44typedef struct lutil_HASHContext lutil_HASH_CTX;
45
46LDAP_END_DECL
47
48#endif /* _LUTIL_HASH_H_ */
49