2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2014 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 /* This version is based on:
17 * $OpenBSD: sha1.h,v 1.8 1997/07/15 01:54:23 millert Exp $ */
19 #ifndef _LUTIL_SHA1_H_
20 #define _LUTIL_SHA1_H_
22 #include <ldap_cdefs.h>
32 * By Steve Reid <steve@edmweb.com>
34 #define LUTIL_SHA1_BYTES 20
36 /* This code assumes char are 8-bits and uint32 are 32-bits */
37 typedef ac_uint4 uint32;
42 unsigned char buffer[64];
47 LDAP_P((uint32 state[5], const unsigned char buffer[64]));
51 LDAP_P((lutil_SHA1_CTX *context));
55 LDAP_P((lutil_SHA1_CTX *context, const unsigned char *data, uint32 len));
59 LDAP_P((unsigned char digest[20], lutil_SHA1_CTX *context));
61 LDAP_LUTIL_F( char * )
63 LDAP_P((lutil_SHA1_CTX *, char *));
65 LDAP_LUTIL_F( char * )
67 LDAP_P((char *, char *));
69 LDAP_LUTIL_F( char * )
71 LDAP_P((const unsigned char *, size_t, char *));
75 #endif /* AC_INT4_TYPE */
77 #endif /* _LUTIL_SHA1_H_ */