]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/feeHash.h
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_cryptkit / lib / feeHash.h
1 /* Copyright (c) 1998,2011,2014 Apple 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, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
10 *
11 * FeeHash.h - generic, portable MD5 hash object
12 *
13 * Revision History
14 * ----------------
15 * 22 Aug 96 at NeXT
16 * Created.
17 */
18
19 #ifndef _CK_FEEHASH_H_
20 #define _CK_FEEHASH_H_
21
22 #if !defined(__MACH__)
23 #include <ckconfig.h>
24 #include <feeTypes.h>
25 #else
26 #include <security_cryptkit/ckconfig.h>
27 #include <security_cryptkit/feeTypes.h>
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /*
35 * Opaque hash object handle.
36 */
37 typedef void *feeHash;
38
39 /*
40 * Alloc and init an empty hash object.
41 */
42 feeHash feeHashAlloc(void);
43
44 /*
45 * reinitialize a hash object for reuse.
46 */
47 void feeHashReinit(feeHash hash);
48
49 /*
50 * Free a hash object.
51 */
52 void feeHashFree(feeHash hash);
53
54 /*
55 * Add some data to the hash object.
56 */
57 void feeHashAddData(feeHash hash,
58 const unsigned char *data,
59 unsigned dataLen);
60
61 /*
62 * Obtain a pointer to completed message digest. This disables further calls
63 * to feeHashAddData(). This pointer is NOT malloc'd; the associated data
64 * persists only as long as this object does.
65 */
66 unsigned char *feeHashDigest(feeHash hash);
67
68 /*
69 * Obtain the length of the message digest.
70 */
71 unsigned feeHashDigestLen(void);
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif /*_CK_FEEHASH_H_*/