]> git.saurik.com Git - apple/security.git/blob - AppleCSP/MiscCSPAlgs/MD5.h
Security-54.tar.gz
[apple/security.git] / AppleCSP / MiscCSPAlgs / MD5.h
1 /*
2 File: MD5.h
3
4 Written by: Colin Plumb
5
6 Copyright: Copyright 1998 by Apple Computer, Inc., all rights reserved.
7
8 Change History (most recent first):
9
10 <8> 10/06/98 ap Changed to compile with C++.
11
12 To Do:
13 */
14
15 /* Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
16 *
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 COMPUTER, INC. AND THE
20 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER,
21 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
22 * EXPOSE YOU TO LIABILITY.
23 ***************************************************************************
24 *
25 * MD5.h
26 * derived and used without need for permission from public domain source
27 */
28
29 #ifndef _CK_MD5_H_
30 #define _CK_MD5_H_
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #ifdef __alpha
37 typedef unsigned int uint32;
38 #elif defined (macintosh)
39 typedef unsigned int uint32;
40 #else
41 #include <Security/cssmconfig.h>
42 //typedef unsigned long uint32;
43 #endif
44
45 struct MD5Context {
46 uint32 buf[4];
47 uint32 bits[2]; // bits[0] is low 32 bits of bit count
48 unsigned char in[64];
49 };
50
51 #define MD5_DIGEST_SIZE 16 /* in bytes */
52
53 void MD5Init(struct MD5Context *context);
54 void MD5Update(struct MD5Context *context, unsigned char const *buf,
55 unsigned len);
56 void MD5Final(struct MD5Context *context, unsigned char *digest);
57
58 /*
59 * This is needed to make RSAREF happy on some MS-DOS compilers.
60 */
61 typedef struct MD5Context MD5_CTX;
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif /*_CK_MD5_H_*/