sprint 1-alpha
|
00001 #ifndef _MD5_H 00002 #define _MD5_H 00003 00009 /* 00010 ********************************************************************** 00011 ** md5.h -- Header file for implementation of MD5 ** 00012 ** RSA Data Security, Inc. MD5 Message Digest Algorithm ** 00013 ** Created: 2/17/90 RLR ** 00014 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 00015 ** Revised (for MD5): RLR 4/27/91 ** 00016 ** -- G modified to have y&~z instead of y&z ** 00017 ** -- FF, GG, HH modified to add in last register done ** 00018 ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 00019 ** -- distinct additive constant for each step ** 00020 ** -- round 4 added, working mod 7 ** 00021 ********************************************************************** 00022 */ 00023 00024 /* 00025 ********************************************************************** 00026 ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** 00027 ** ** 00028 ** License to copy and use this software is granted provided that ** 00029 ** it is identified as the "RSA Data Security, Inc. MD5 Message ** 00030 ** Digest Algorithm" in all material mentioning or referencing this ** 00031 ** software or this function. ** 00032 ** ** 00033 ** License is also granted to make and use derivative works ** 00034 ** provided that such works are identified as "derived from the RSA ** 00035 ** Data Security, Inc. MD5 Message Digest Algorithm" in all ** 00036 ** material mentioning or referencing the derived work. ** 00037 ** ** 00038 ** RSA Data Security, Inc. makes no representations concerning ** 00039 ** either the merchantability of this software or the suitability ** 00040 ** of this software for any particular purpose. It is provided "as ** 00041 ** is" without express or implied warranty of any kind. ** 00042 ** ** 00043 ** These notices must be retained in any copies of any part of this ** 00044 ** documentation and/or software. ** 00045 ********************************************************************** 00046 */ 00047 00048 /* typedef a 32 bit type */ 00049 typedef unsigned long int UINT4; 00050 00052 class MD5 { 00053 UINT4 m_i[2]; 00054 UINT4 m_buf[4]; 00055 unsigned char m_in[64]; 00056 unsigned char m_digest[16]; 00057 public: 00058 00060 static const int DigestSize = 16; 00061 00062 public: 00063 MD5(); 00064 00066 void Update(const unsigned char *inBuf, unsigned int inLen); 00067 00069 void Final(); 00070 00072 const unsigned char *Digest() const { return m_digest; } 00073 00074 }; 00075 00076 /* 00077 ********************************************************************** 00078 ** End of md5.h ** 00079 ******************************* (cut) ******************************** 00080 */ 00081 00082 #endif