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