2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2013 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
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>.
16 #ifndef _LUTIL_HASH_H_
17 #define _LUTIL_HASH_H_
19 #include <lber_types.h>
23 #define LUTIL_HASH_BYTES 4
27 typedef union lutil_HASHContext {
29 unsigned long long hash64;
32 #else /* !HAVE_LONG_LONG */
34 typedef struct lutil_HASHContext {
38 #endif /* HAVE_LONG_LONG */
41 lutil_HASHInit LDAP_P((
42 lutil_HASH_CTX *context));
45 lutil_HASHUpdate LDAP_P((
46 lutil_HASH_CTX *context,
47 unsigned char const *buf,
51 lutil_HASHFinal LDAP_P((
52 unsigned char digest[LUTIL_HASH_BYTES],
53 lutil_HASH_CTX *context));
57 #define LUTIL_HASH64_BYTES 8
60 lutil_HASH64Init LDAP_P((
61 lutil_HASH_CTX *context));
64 lutil_HASH64Update LDAP_P((
65 lutil_HASH_CTX *context,
66 unsigned char const *buf,
70 lutil_HASH64Final LDAP_P((
71 unsigned char digest[LUTIL_HASH64_BYTES],
72 lutil_HASH_CTX *context));
74 #endif /* HAVE_LONG_LONG */
78 #endif /* _LUTIL_HASH_H_ */