]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/ckMD5.h
4 Written by: Colin Plumb
6 Copyright: Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
8 Change History (most recent first):
10 <8> 10/06/98 ap Changed to compile with C++.
15 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
17 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
18 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
19 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
20 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
21 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
22 * EXPOSE YOU TO LIABILITY.
23 ***************************************************************************
26 * derived and used without need for permission from public domain source
34 #if CRYPTKIT_MD5_ENABLE
35 #if CRYPTKIT_LIBMD_DIGEST
38 * In this case we use the MD5 implementation in libSystem.
40 #include <CommonCrypto/CommonDigest.h>
42 typedef CC_MD5_CTX MD5Context
;
44 #define MD5Init(c) CC_MD5_Init(c)
45 #define MD5Update(c, d, l) CC_MD5_Update(c, d, l)
46 #define MD5Final(c, d) CC_MD5_Final(d, c)
48 #define MD5_DIGEST_SIZE CC_MD5_DIGEST_LENGTH
50 #else /* ! CRYPTKIT_LIBMD_DIGEST */
52 /* Our own private implementation */
59 typedef unsigned int UINT32
;
60 #elif defined (macintosh) || defined (__ppc__)
61 typedef unsigned int UINT32
;
63 typedef unsigned long UINT32
;
68 UINT32 bits
[2]; // bits[0] is low 32 bits of bit count
72 #define MD5_DIGEST_SIZE 16 /* in bytes */
74 void MD5Init(MD5Context
*context
);
75 void MD5Update(MD5Context
*context
, unsigned char const *buf
,
77 void MD5Final(MD5Context
*context
, unsigned char *digest
);
80 * This is needed to make RSAREF happy on some MS-DOS compilers.
82 typedef MD5Context MD5_CTX
;
88 #endif /* CRYPTKIT_LIBMD_DIGEST */
89 #endif /* CRYPTKIT_MD5_ENABLE */