]> git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/hashTimeSA/SHA1.h
Security-57031.10.10.tar.gz
[apple/security.git] / SecurityTests / cspxutils / hashTimeSA / SHA1.h
1 /* Copyright (c) 1998,2004 Apple Computer, Inc. All Rights Reserved.
2 *
3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE COMPUTER, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
10 *
11 * SHA1.h - generic, portable SHA-1 hash object
12 *
13 * Revision History
14 * ----------------
15 * 05 Jan 1998 Doug Mitchell at Apple
16 * Created.
17 */
18
19 #ifndef _CK_SHA1_H_
20 #define _CK_SHA1_H_
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #define SHA1_DIGEST_SIZE 20 /* in bytes */
27 #define SHA1_BLOCK_SIZE 64 /* in bytes */
28
29 /*
30 * Opaque sha1 object handle.
31 */
32 typedef void *sha1Obj;
33
34 /*
35 * Alloc and init an empty sha1 object.
36 */
37 sha1Obj sha1Alloc(void);
38
39 /*
40 * reinitialize an sha1 object for reuse.
41 */
42 void sha1Reinit(sha1Obj sha1);
43
44 /*
45 * Free an sha1 object.
46 */
47 void sha1Free(sha1Obj sha1);
48
49 /*
50 * Add some data to the sha1 object.
51 */
52 void sha1AddData(sha1Obj sha1,
53 const unsigned char *data,
54 unsigned dataLen);
55
56 /*
57 * Obtain a pointer to completed message digest. This disables further calls
58 * to sha1AddData(). This pointer is NOT malloc'd; the associated data
59 * persists only as long as this object does.
60 */
61 unsigned char *sha1Digest(sha1Obj sha1);
62
63 /* As above, with copy. */
64 void sha1GetDigest(sha1Obj sha1,
65 unsigned char *digest);
66
67 /*
68 * Obtain the length of the message digest.
69 */
70 unsigned sha1DigestLen(void);
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif /*_CK_SHA1_H_*/