2
---------------------------------------------------------------------------
3
Copyright (c) 2002, Dr Brian Gladman < >, Worcester, UK.
8
The free distribution and use of this software in both source and binary
9
form is allowed (with or without changes) provided that:
11
1. distributions of this source code include the above copyright
12
notice, this list of conditions and the following disclaimer;
14
2. distributions in binary form include the above copyright
15
notice, this list of conditions and the following disclaimer
16
in the documentation and/or other associated materials;
18
3. the copyright holder's name is not used to endorse products
19
built using this software without specific written permission.
21
ALTERNATIVELY, provided that this notice is retained in full, this product
22
may be distributed under the terms of the GNU General Public License (GPL),
23
in which case the provisions of the GPL apply INSTEAD OF those given above.
27
This software is provided 'as is' with no explicit or implied warranties
28
in respect of its properties, including, but not limited to, correctness
29
and/or fitness for purpose.
30
---------------------------------------------------------------------------
31
Issue Date: 26/08/2003
39
#define SHA1_BLOCK_SIZE 64
40
#define SHA1_DIGEST_SIZE 20
42
/* define an unsigned 32-bit type */
44
#if UINT_MAX == 0xffffffff
45
typedef unsigned int sha1_32t;
46
#elif ULONG_MAX == 0xffffffff
47
typedef unsigned long sha1_32t;
49
#error Please define sha1_32t as an unsigned 32 bit type in sha2.h
52
/* type to hold the SHA256 context */
60
void sha1_compile(sha1_ctx ctx[1]);
62
void sha1_begin(sha1_ctx ctx[1]);
63
void sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]);
64
void sha1_end(unsigned char hval[], sha1_ctx ctx[1]);
65
void sha1(unsigned char hval[], const unsigned char data[], unsigned long len);