]>
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
27 * Opaque sha1 object handle.
29 typedef void *sha1Obj
;
32 * Alloc and init an empty sha1 object.
34 sha1Obj
sha1Alloc(void);
37 * reinitialize an sha1 object for reuse.
39 void sha1Reinit(sha1Obj sha1
);
42 * Free an sha1 object.
44 void sha1Free(sha1Obj sha1
);
47 * Add some data to the sha1 object.
49 void sha1AddData(sha1Obj sha1
,
50 const unsigned char *data
,
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.
58 unsigned char *sha1Digest(sha1Obj sha1
);
60 /* As above, with copy. */
61 void sha1GetDigest(sha1Obj sha1
,
62 unsigned char *digest
);
65 * Obtain the length of the message digest.
67 unsigned sha1DigestLen(void);
73 #endif /*_CK_SHA1_H_*/