Back to index

openldap  2.4.31
lutil_hash.h
Go to the documentation of this file.
00001 /* $OpenLDAP$ */
00002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00003  *
00004  * Copyright 1998-2012 The OpenLDAP Foundation.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted only as authorized by the OpenLDAP
00009  * Public License.
00010  *
00011  * A copy of this license is available in file LICENSE in the
00012  * top-level directory of the distribution or, alternatively, at
00013  * <http://www.OpenLDAP.org/license.html>.
00014  */
00015 
00016 #ifndef _LUTIL_HASH_H_
00017 #define _LUTIL_HASH_H_
00018 
00019 #include <lber_types.h>
00020 
00021 LDAP_BEGIN_DECL
00022 
00023 #define LUTIL_HASH_BYTES 4
00024 
00025 struct lutil_HASHContext {
00026        ber_uint_t hash;
00027 };
00028 
00029 LDAP_LUTIL_F( void )
00030 lutil_HASHInit LDAP_P((
00031        struct lutil_HASHContext *context));
00032 
00033 LDAP_LUTIL_F( void )
00034 lutil_HASHUpdate LDAP_P((
00035        struct lutil_HASHContext *context,
00036        unsigned char const *buf,
00037        ber_len_t len));
00038 
00039 LDAP_LUTIL_F( void )
00040 lutil_HASHFinal LDAP_P((
00041        unsigned char digest[LUTIL_HASH_BYTES],
00042        struct lutil_HASHContext *context));
00043 
00044 typedef struct lutil_HASHContext lutil_HASH_CTX;
00045 
00046 LDAP_END_DECL
00047 
00048 #endif /* _LUTIL_HASH_H_ */