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