added iOS source code
[wl-app.git] / iOS / Pods / SSZipArchive / SSZipArchive / minizip / aes / sha1.h
1 /*
2 ---------------------------------------------------------------------------
3 Copyright (c) 1998-2010, Brian Gladman, Worcester, UK. All rights reserved.
4
5 The redistribution and use of this software (with or without changes)
6 is allowed without the payment of fees or royalties provided that:
7
8   source code distributions include the above copyright notice, this
9   list of conditions and the following disclaimer;
10
11   binary distributions include the above copyright notice, this list
12   of conditions and the following disclaimer in their documentation.
13
14 This software is provided 'as is' with no explicit or implied warranties
15 in respect of its operation, including, but not limited to, correctness
16 and fitness for purpose.
17 ---------------------------------------------------------------------------
18 Issue Date: 20/12/2007
19 */
20
21 #ifndef _SHA1_H
22 #define _SHA1_H
23
24 #define SHA_1
25
26 /* define for bit or byte oriented SHA   */
27 #if 1
28 #  define SHA1_BITS 0   /* byte oriented */
29 #else
30 #  define SHA1_BITS 1   /* bit oriented  */
31 #endif
32
33 #include <stdlib.h>
34 #include "brg_types.h"
35
36 #define SHA1_BLOCK_SIZE  64
37 #define SHA1_DIGEST_SIZE 20
38
39 #if defined(__cplusplus)
40 extern "C"
41 {
42 #endif
43
44 /* type to hold the SHA256 context  */
45
46 typedef struct
47 {   uint32_t count[2];
48     uint32_t hash[SHA1_DIGEST_SIZE >> 2];
49     uint32_t wbuf[SHA1_BLOCK_SIZE >> 2];
50 } sha1_ctx;
51
52 /* Note that these prototypes are the same for both bit and */
53 /* byte oriented implementations. However the length fields */
54 /* are in bytes or bits as appropriate for the version used */
55 /* and bit sequences are input as arrays of bytes in which  */
56 /* bit sequences run from the most to the least significant */
57 /* end of each byte. The value 'len' in sha1_hash for the   */
58 /* byte oriented version of SHA1 is limited to 2^29 bytes,  */
59 /* but multiple calls will handle longer data blocks.       */
60
61 VOID_RETURN sha1_compile(sha1_ctx ctx[1]);
62
63 VOID_RETURN sha1_begin(sha1_ctx ctx[1]);
64 VOID_RETURN sha1_hash(const unsigned char data[], unsigned long len, sha1_ctx ctx[1]);
65 VOID_RETURN sha1_end(unsigned char hval[], sha1_ctx ctx[1]);
66 VOID_RETURN sha1(unsigned char hval[], const unsigned char data[], unsigned long len);
67
68 #if defined(__cplusplus)
69 }
70 #endif
71
72 #endif