]>
git.saurik.com Git - apple/security.git/blob - AppleCSP/MiscCSPAlgs/SHA1.h
1 /* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
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 ***************************************************************************
11 * SHA1.h - generic, portable SHA-1 hash object
15 * 05 Jan 1998 Doug Mitchell at Apple
26 #define SHA1_DIGEST_SIZE 20 /* in bytes */
27 #define SHA1_BLOCK_SIZE 64 /* in bytes */
30 * Opaque sha1 object handle.
32 typedef void *sha1Obj
;
35 * Alloc and init an empty sha1 object.
37 sha1Obj
sha1Alloc(void);
40 * reinitialize an sha1 object for reuse.
42 void sha1Reinit(sha1Obj sha1
);
45 * Free an sha1 object.
47 void sha1Free(sha1Obj sha1
);
50 * Add some data to the sha1 object.
52 void sha1AddData(sha1Obj sha1
,
53 const unsigned char *data
,
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.
61 unsigned char *sha1Digest(sha1Obj sha1
);
63 /* As above, with copy. */
64 void sha1GetDigest(sha1Obj sha1
,
65 unsigned char *digest
);
68 * Obtain the length of the message digest.
70 unsigned sha1DigestLen(void);
76 #endif /*_CK_SHA1_H_*/