2 ---------------------------------------------------------------------------
3 Copyright (c) 2002, Dr Brian Gladman, Worcester, UK. All rights reserved.
7 The free distribution and use of this software is allowed (with or without
8 changes) provided that:
10 1. source code distributions include the above copyright notice, this
11 list of conditions and the following disclaimer;
13 2. binary distributions include the above copyright notice, this list
14 of conditions and the following disclaimer in their documentation;
16 3. the name of the copyright holder is not used to endorse products
17 built using this software without specific written permission.
21 This software is provided 'as is' with no explicit or implied warranties
22 in respect of its properties, including, but not limited to, correctness
23 and/or fitness for purpose.
24 ---------------------------------------------------------------------------
25 Issue Date: 26/08/2003
33 #define SHA1_BLOCK_SIZE 64
34 #define SHA1_DIGEST_SIZE 20
36 #if defined(__cplusplus)
41 /* define an unsigned 32-bit type */
44 typedef unsigned __int32 sha1_32t
;
45 #elif defined(ULONG_MAX) && ULONG_MAX == 0xfffffffful
46 typedef unsigned __int32 sha1_32t
;
47 #elif defined(UINT_MAX) && UINT_MAX == 0xffffffff
48 typedef unsigned int sha1_32t
;
50 # error Please define sha1_32t as an unsigned 32 bit type in sha1.h
53 /* type to hold the SHA256 context */
61 /* Note that these prototypes are the same for both bit and */
62 /* byte oriented implementations. However the length fields */
63 /* are in bytes or bits as appropriate for the version used */
64 /* and bit sequences are input as arrays of bytes in which */
65 /* bit sequences run from the most to the least significant */
66 /* end of each byte */
68 void sha1_compile(sha1_ctx ctx
[1]);
70 void sha1_begin(sha1_ctx ctx
[1]);
71 void sha1_hash(const unsigned char data
[], unsigned __int32 len
, sha1_ctx ctx
[1]);
72 void sha1_end(unsigned char hval
[], sha1_ctx ctx
[1]);
73 void sha1(unsigned char hval
[], const unsigned char data
[], unsigned __int32 len
);
75 #if defined(__cplusplus)