1*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 2*7c478bd9Sstevel@tonic-gate extern "C" { 3*7c478bd9Sstevel@tonic-gate #endif 4*7c478bd9Sstevel@tonic-gate 5*7c478bd9Sstevel@tonic-gate /* 6*7c478bd9Sstevel@tonic-gate *********************************************************************** 7*7c478bd9Sstevel@tonic-gate ** md5.h -- header file for implementation of MD5 ** 8*7c478bd9Sstevel@tonic-gate ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 9*7c478bd9Sstevel@tonic-gate ** Created: 2/17/90 RLR ** 10*7c478bd9Sstevel@tonic-gate ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 11*7c478bd9Sstevel@tonic-gate ** Revised (for MD5): RLR 4/27/91 ** 12*7c478bd9Sstevel@tonic-gate ** -- G modified to have y&~z instead of y&z ** 13*7c478bd9Sstevel@tonic-gate ** -- FF, GG, HH modified to add in last register done ** 14*7c478bd9Sstevel@tonic-gate ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 15*7c478bd9Sstevel@tonic-gate ** -- distinct additive constant for each step ** 16*7c478bd9Sstevel@tonic-gate ** -- round 4 added, working mod 7 ** 17*7c478bd9Sstevel@tonic-gate *********************************************************************** 18*7c478bd9Sstevel@tonic-gate */ 19*7c478bd9Sstevel@tonic-gate 20*7c478bd9Sstevel@tonic-gate /* 21*7c478bd9Sstevel@tonic-gate *********************************************************************** 22*7c478bd9Sstevel@tonic-gate ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** 23*7c478bd9Sstevel@tonic-gate ** ** 24*7c478bd9Sstevel@tonic-gate ** License to copy and use this software is granted provided that ** 25*7c478bd9Sstevel@tonic-gate ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** 26*7c478bd9Sstevel@tonic-gate ** Digest Algorithm" in all material mentioning or referencing this ** 27*7c478bd9Sstevel@tonic-gate ** software or this function. ** 28*7c478bd9Sstevel@tonic-gate ** ** 29*7c478bd9Sstevel@tonic-gate ** License is also granted to make and use derivative works ** 30*7c478bd9Sstevel@tonic-gate ** provided that such works are identified as "derived from the RSA ** 31*7c478bd9Sstevel@tonic-gate ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** 32*7c478bd9Sstevel@tonic-gate ** material mentioning or referencing the derived work. ** 33*7c478bd9Sstevel@tonic-gate ** ** 34*7c478bd9Sstevel@tonic-gate ** RSA Data Security, Inc. makes no representations concerning ** 35*7c478bd9Sstevel@tonic-gate ** either the merchantability of this software or the suitability ** 36*7c478bd9Sstevel@tonic-gate ** of this software for any particular purpose. It is provided "as ** 37*7c478bd9Sstevel@tonic-gate ** is" without express or implied warranty of any kind. ** 38*7c478bd9Sstevel@tonic-gate ** ** 39*7c478bd9Sstevel@tonic-gate ** These notices must be retained in any copies of any part of this ** 40*7c478bd9Sstevel@tonic-gate ** documentation and/or software. ** 41*7c478bd9Sstevel@tonic-gate *********************************************************************** 42*7c478bd9Sstevel@tonic-gate */ 43*7c478bd9Sstevel@tonic-gate 44*7c478bd9Sstevel@tonic-gate /* typedef a 32-bit type */ 45*7c478bd9Sstevel@tonic-gate typedef unsigned long int UINT4; 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate /* Data structure for MD5 (Message-Digest) computation */ 48*7c478bd9Sstevel@tonic-gate typedef struct { 49*7c478bd9Sstevel@tonic-gate UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ 50*7c478bd9Sstevel@tonic-gate UINT4 buf[4]; /* scratch buffer */ 51*7c478bd9Sstevel@tonic-gate unsigned char in[64]; /* input buffer */ 52*7c478bd9Sstevel@tonic-gate unsigned char digest[16]; /* actual digest after MD5Final call */ 53*7c478bd9Sstevel@tonic-gate } MD5_CTX; 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate void MD5Init (MD5_CTX *mdContext); 56*7c478bd9Sstevel@tonic-gate void MD5Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen); 57*7c478bd9Sstevel@tonic-gate void MD5Final (MD5_CTX *mdContext); 58*7c478bd9Sstevel@tonic-gate 59*7c478bd9Sstevel@tonic-gate 60*7c478bd9Sstevel@tonic-gate 61*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 62*7c478bd9Sstevel@tonic-gate } 63*7c478bd9Sstevel@tonic-gate #endif 64