X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5dd5f9ec28f304ca377c42fd7f711d6cf12b90e1..5c19dc3ae3bd8e40a9c028b0deddd50ff337692c:/OSX/libsecurity_cryptkit/lib/feeHash.h diff --git a/OSX/libsecurity_cryptkit/lib/feeHash.h b/OSX/libsecurity_cryptkit/lib/feeHash.h new file mode 100644 index 00000000..bcb66398 --- /dev/null +++ b/OSX/libsecurity_cryptkit/lib/feeHash.h @@ -0,0 +1,81 @@ +/* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved. + * + * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT + * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE + * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE + * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE, + * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL + * EXPOSE YOU TO LIABILITY. + *************************************************************************** + * + * FeeHash.h - generic, portable MD5 hash object + * + * Revision History + * ---------------- + * 22 Aug 96 at NeXT + * Created. + */ + +#ifndef _CK_FEEHASH_H_ +#define _CK_FEEHASH_H_ + +#if !defined(__MACH__) +#include +#include +#else +#include +#include +#endif + +#if CRYPTKIT_MD5_ENABLE + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Opaque hash object handle. + */ +typedef void *feeHash; + +/* + * Alloc and init an empty hash object. + */ +feeHash feeHashAlloc(void); + +/* + * reinitialize a hash object for reuse. + */ +void feeHashReinit(feeHash hash); + +/* + * Free a hash object. + */ +void feeHashFree(feeHash hash); + +/* + * Add some data to the hash object. + */ +void feeHashAddData(feeHash hash, + const unsigned char *data, + unsigned dataLen); + +/* + * Obtain a pointer to completed message digest. This disables further calls + * to feeHashAddData(). This pointer is NOT malloc'd; the associated data + * persists only as long as this object does. + */ +unsigned char *feeHashDigest(feeHash hash); + +/* + * Obtain the length of the message digest. + */ +unsigned feeHashDigestLen(void); + +#ifdef __cplusplus +} +#endif + +#endif /* CRYPTKIT_MD5_ENABLE */ + +#endif /*_CK_FEEHASH_H_*/