00001 /* MD5.H - header file for MD5C.C 00002 */ 00003 00004 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 00005 rights reserved. 00006 00007 License to copy and use this software is granted provided that it 00008 is identified as the "RSA Data Security, Inc. MD5 Message-Digest 00009 Algorithm" in all material mentioning or referencing this software 00010 or this function. 00011 00012 License is also granted to make and use derivative works provided 00013 that such works are identified as "derived from the RSA Data 00014 Security, Inc. MD5 Message-Digest Algorithm" in all material 00015 mentioning or referencing the derived work. 00016 00017 RSA Data Security, Inc. makes no representations concerning either 00018 the merchantability of this software or the suitability of this 00019 software for any particular purpose. It is provided "as is" 00020 without express or implied warranty of any kind. 00021 00022 These notices must be retained in any copies of any part of this 00023 documentation and/or software. 00024 */ 00025 00026 /* GLOBAL.H - RSAREF types and constants 00027 */ 00028 00029 /* PROTOTYPES should be set to one if and only if the compiler supports 00030 function argument prototyping. 00031 The following makes PROTOTYPES default to 0 if it has not already 00032 been defined with C compiler flags. 00033 */ 00034 00035 #ifndef PROTOTYPES 00036 #define PROTOTYPES 0 00037 #endif 00038 00039 /* POINTER defines a generic pointer type */ 00040 typedef unsigned char *POINTER; 00041 00042 /* UINT2 defines a two byte word */ 00043 typedef unsigned short int UINT2; 00044 00045 /* UINT4 defines a four byte word */ 00046 typedef unsigned long int UINT4; 00047 00048 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 00049 If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 00050 returns an empty list. 00051 */ 00052 #if PROTOTYPES 00053 #define PROTO_LIST(list) list 00054 #else 00055 #define PROTO_LIST(list) () 00056 #endif 00057 00059 typedef struct { 00060 UINT4 state[4]; /* state (ABCD) */ 00061 UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 00062 unsigned char buffer[64]; /* input buffer */ 00063 } MD5_CTX; 00064 00065 void MD5Init PROTO_LIST ((MD5_CTX *)); 00066 void MD5Update PROTO_LIST 00067 ((MD5_CTX *, unsigned char *, unsigned int)); 00068 void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); 00069