1 /* $Id: pc_md5.h,v 1.5 2006/08/11 16:14:34 tm Exp $
2  *
3  * Header file for the PDFlib MD5 message digest routines
4  *
5  */
6 
7 /* This is a slightly modified version of the RSA reference
8  * implementation for MD5, which originally contained
9  * the following copyright notice:
10  */
11 
12 /*  Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
13     rights reserved.
14 
15     License to copy and use this software is granted provided that it
16     is identified as the "RSA Data Security, Inc. MD5 Message-Digest
17     Algorithm" in all material mentioning or referencing this software
18     or this function.
19 
20     License is also granted to make and use derivative works provided
21     that such works are identified as "derived from the RSA Data
22     Security, Inc. MD5 Message-Digest Algorithm" in all material
23     mentioning or referencing the derived work.
24 
25     RSA Data Security, Inc. makes no representations concerning either
26     the merchantability of this software or the suitability of this
27     software for any particular purpose. It is provided "as is"
28     without express or implied warranty of any kind.
29 
30     These notices must be retained in any copies of any part of this
31     documentation and/or software.
32  */
33 
34 
35 /* we prefix our MD5 function and structure names with "pdc_", so you can
36  * link your program with another MD5 lib without troubles.
37  */
38 #define MD5_Init	pdc_MD5_Init
39 #define MD5_Update	pdc_MD5_Update
40 #define MD5_Final	pdc_MD5_Final
41 
42 #define MD5_CTX		pdc_MD5_CTX
43 
44 typedef unsigned int MD5_UINT4;
45 
46 #define MD5_DIGEST_LENGTH	16
47 
48 
49 /* MD5 context. */
50 typedef struct {
51     MD5_UINT4 state[4];		/* state (ABCD) */
52     MD5_UINT4 count[2];		/* number of bits, modulo 2^64 (lsb first) */
53     unsigned char buffer[64];	/* input buffer */
54 } MD5_CTX;
55 
56 void MD5_Init(MD5_CTX *context);
57 void MD5_Update(
58 	MD5_CTX *context, const unsigned char *input, unsigned int inputLen);
59 void MD5_Final(unsigned char digest[MD5_DIGEST_LENGTH], MD5_CTX *context);
60