]> git.saurik.com Git - apple/security.git/blame - SecurityTests/cspxutils/hashTime/MD5.h
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / cspxutils / hashTime / MD5.h
CommitLineData
d8f41ccd
A
1/*
2 File: MD5.h
3
4 Written by: Colin Plumb
5
6 Copyright: Copyright (c) 1998,2004 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,2004 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
33extern "C" {
34#endif
35
36#ifdef __alpha
37typedef unsigned int uint32;
38#elif defined (macintosh)
39typedef unsigned int uint32;
40#else
41#include <Security/cssmconfig.h>
42//typedef unsigned long uint32;
43#endif
44
45struct 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#define MD5_BLOCK_SIZE 64 /* in bytes */
53
54void MD5Init(struct MD5Context *context);
55void MD5Update(struct MD5Context *context, unsigned char const *buf,
56 unsigned len);
57void MD5Final(struct MD5Context *context, unsigned char *digest);
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif /*_CK_MD5_H_*/