3 ***********************************************************************
4 ** utl_md5.h -- header file for implementation of MD5 **
5 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
6 ** Created: 2/17/90 RLR **
7 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
8 ** Revised (for MD5): RLR 4/27/91 **
9 ** -- G modified to have y&~z instead of y&z **
10 ** -- FF, GG, HH modified to add in last register done **
11 ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
12 ** -- distinct additive constant for each step **
13 ** -- round 4 added, working mod 7 **
14 ***********************************************************************
18 ***********************************************************************
19 ** Message-digest routines: **
20 ** To form the message digest for a message M **
21 ** (1) Initialize a context buffer mdContext using MD5Init **
22 ** (2) Call MD5Update on mdContext and M **
23 ** (3) Call MD5Final on mdContext **
24 ** The message digest is now in mdContext->digest[0...15] **
25 ***********************************************************************
31 /* Set up for C function definitions, even when using C++ */
36 /* ------------ Definitions --------- */
38 /* typedef a 32-bit type */
39 typedef unsigned long int MD5UINT4;
41 /* Data structure for MD5 (Message-Digest) computation */
43 MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
44 MD5UINT4 buf[4]; /* scratch buffer */
45 unsigned char in[64]; /* input buffer */
46 unsigned char digest[16]; /* actual digest after MD5Final call */
49 /* ---------- Function Prototypes ------------- */
53 #define DLLINTERFACE __declspec(dllexport)
55 #define DLLINTERFACE __declspec(dllimport)
62 * utl_md5Init: initialize the context
66 * mdContext pointer to context variable
72 * Note: The function initializes the message-digest context
73 * mdContext. Call before each new use of the context -
74 * all fields are set to zero.
76 DLLINTERFACE void utl_md5Init(MD5_CTX * mdContext);
80 * utl_md5update: update digest from variable length data
84 * mdContext pointer to context variable
85 * inBuf pointer to data array/string
86 * inLen length of data array/string
92 * Note: The function updates the message-digest context to account
93 * for the presence of each of the characters inBuf[0..inLen-1]
94 * in the message whose digest is being computed.
97 DLLINTERFACE void utl_md5Update(MD5_CTX * mdContext, unsigned char *inBuf,
102 * utl_md5Final: complete digest computation
106 * mdContext pointer to context variable
112 * Note: The function terminates the message-digest computation and
113 * ends with the desired message digest in mdContext.digest[0..15].
114 * Always call before using the digest[] variable.
117 DLLINTERFACE void utl_md5Final(MD5_CTX * mdContext);
120 /* Ends C function definitions when using C++ */
125 #endif /* _utl_md5_h */