]> git.sur5r.net Git - openldap/blob - include/lutil_sha1.h
Remove SCHEMA_NOT_COMPAT #ifdef
[openldap] / include / lutil_sha1.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted only
7  * as authorized by the OpenLDAP Public License.  A copy of this
8  * license is available at http://www.OpenLDAP.org/license.html or
9  * in file LICENSE in the top-level directory of the distribution.
10  */
11
12 /* This version is based on:
13  *      $OpenBSD: sha1.h,v 1.8 1997/07/15 01:54:23 millert Exp $        */
14
15 #ifndef _LUTIL_SHA1_H_
16 #define _LUTIL_SHA1_H_
17
18 #include <ldap_cdefs.h>
19 #include <ac/bytes.h>
20
21 LDAP_BEGIN_DECL
22
23 /*
24  * SHA-1 in C
25  * By Steve Reid <steve@edmweb.com>
26  */
27 #define LUTIL_SHA1_BYTES 20
28
29 /* This code assumes char are 8-bits and uint32 are 32-bits */
30 typedef ac_uint4 uint32;
31
32 typedef struct {
33     uint32 state[5];
34     uint32 count[2];  
35     unsigned char buffer[64];
36 } lutil_SHA1_CTX;
37   
38 LDAP_LUTIL_F( void )
39 lutil_SHA1Transform
40         LDAP_P((uint32 state[5], const unsigned char buffer[64]));
41
42 LDAP_LUTIL_F( void  )
43 lutil_SHA1Init
44         LDAP_P((lutil_SHA1_CTX *context));
45
46 LDAP_LUTIL_F( void  )
47 lutil_SHA1Update
48         LDAP_P((lutil_SHA1_CTX *context, const unsigned char *data, uint32 len));
49
50 LDAP_LUTIL_F( void  )
51 lutil_SHA1Final
52         LDAP_P((unsigned char digest[20], lutil_SHA1_CTX *context));
53
54 LDAP_LUTIL_F( char * )
55 lutil_SHA1End
56         LDAP_P((lutil_SHA1_CTX *, char *));
57
58 LDAP_LUTIL_F( char * )
59 lutil_SHA1File
60         LDAP_P((char *, char *));
61
62 LDAP_LUTIL_F( char * )
63 lutil_SHA1Data
64         LDAP_P((const unsigned char *, size_t, char *));
65
66 LDAP_END_DECL
67
68 #endif /* _LUTIL_SHA1_H_ */