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