]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/feeHash.h
Security-58286.51.6.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 #if CRYPTKIT_MD5_ENABLE
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /*
37 * Opaque hash object handle.
38 */
39 typedef void *feeHash;
40
41 /*
42 * Alloc and init an empty hash object.
43 */
44 feeHash feeHashAlloc(void);
45
46 /*
47 * reinitialize a hash object for reuse.
48 */
49 void feeHashReinit(feeHash hash);
50
51 /*
52 * Free a hash object.
53 */
54 void feeHashFree(feeHash hash);
55
56 /*
57 * Add some data to the hash object.
58 */
59 void feeHashAddData(feeHash hash,
60 const unsigned char *data,
61 unsigned dataLen);
62
63 /*
64 * Obtain a pointer to completed message digest. This disables further calls
65 * to feeHashAddData(). This pointer is NOT malloc'd; the associated data
66 * persists only as long as this object does.
67 */
68 unsigned char *feeHashDigest(feeHash hash);
69
70 /*
71 * Obtain the length of the message digest.
72 */
73 unsigned feeHashDigestLen(void);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif /* CRYPTKIT_MD5_ENABLE */
80
81 #endif /*_CK_FEEHASH_H_*/