]> git.saurik.com Git - apple/security.git/blob - AppleCSP/MiscCSPAlgs/SHA1.h
Security-54.tar.gz
[apple/security.git] / AppleCSP / MiscCSPAlgs / SHA1.h
1 /* Copyright (c) 1998 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 /*
27 * Opaque sha1 object handle.
28 */
29 typedef void *sha1Obj;
30
31 /*
32 * Alloc and init an empty sha1 object.
33 */
34 sha1Obj sha1Alloc(void);
35
36 /*
37 * reinitialize an sha1 object for reuse.
38 */
39 void sha1Reinit(sha1Obj sha1);
40
41 /*
42 * Free an sha1 object.
43 */
44 void sha1Free(sha1Obj sha1);
45
46 /*
47 * Add some data to the sha1 object.
48 */
49 void sha1AddData(sha1Obj sha1,
50 const unsigned char *data,
51 unsigned dataLen);
52
53 /*
54 * Obtain a pointer to completed message digest. This disables further calls
55 * to sha1AddData(). This pointer is NOT malloc'd; the associated data
56 * persists only as long as this object does.
57 */
58 unsigned char *sha1Digest(sha1Obj sha1);
59
60 /* As above, with copy. */
61 void sha1GetDigest(sha1Obj sha1,
62 unsigned char *digest);
63
64 /*
65 * Obtain the length of the message digest.
66 */
67 unsigned sha1DigestLen(void);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /*_CK_SHA1_H_*/