X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/72a12576750f52947eb043106ba5c12c0d07decf..b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195:/libsecurity_cryptkit/lib/feeHash.h diff --git a/libsecurity_cryptkit/lib/feeHash.h b/libsecurity_cryptkit/lib/feeHash.h new file mode 100644 index 00000000..8cab22fc --- /dev/null +++ b/libsecurity_cryptkit/lib/feeHash.h @@ -0,0 +1,81 @@ +/* Copyright (c) 1998 Apple Computer, 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 COMPUTER, INC. AND THE + * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER, + * 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 Doug Mitchell 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_*/