00001 /* Because MD5 may not be implemented (at least, with the same 00002 * interface) on all systems, we have our own copy here. 00003 */ 00004 00005 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 00006 rights reserved. 00007 00008 License to copy and use this software is granted provided that it 00009 is identified as the "RSA Data Security, Inc. MD5 Message-Digest 00010 Algorithm" in all material mentioning or referencing this software 00011 or this function. 00012 00013 License is also granted to make and use derivative works provided 00014 that such works are identified as "derived from the RSA Data 00015 Security, Inc. MD5 Message-Digest Algorithm" in all material 00016 mentioning or referencing the derived work. 00017 00018 RSA Data Security, Inc. makes no representations concerning either 00019 the merchantability of this software or the suitability of this 00020 software for any particular purpose. It is provided "as is" 00021 without express or implied warranty of any kind. 00022 00023 These notices must be retained in any copies of any part of this 00024 documentation and/or software. 00025 */ 00026 00027 #ifndef _SYS_MD5_H_ 00028 #define _SYS_MD5_H_ 00029 00030 typedef unsigned UNSIGNED32; 00031 00032 /* Definitions of _ANSI_ARGS and EXTERN that will work in either 00033 C or C++ code: 00034 */ 00035 #undef _ANSI_ARGS_ 00036 #if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE) 00037 # define _ANSI_ARGS_(x) x 00038 #else 00039 # define _ANSI_ARGS_(x) () 00040 #endif 00041 #ifdef __cplusplus 00042 # define EXTERN extern "C" 00043 #else 00044 # define EXTERN extern 00045 #endif 00046 00047 /* MD5 context. */ 00048 typedef struct MD5Context { 00049 UNSIGNED32 state[4]; /* state (ABCD) */ 00050 UNSIGNED32 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 00051 unsigned char buffer[64]; /* input buffer */ 00052 } MD5_CTX; 00053 00054 EXTERN void our_MD5Init (MD5_CTX *); 00055 EXTERN void ourMD5Update (MD5_CTX *, const unsigned char *, unsigned int); 00056 EXTERN void our_MD5Pad (MD5_CTX *); 00057 EXTERN void our_MD5Final (unsigned char [16], MD5_CTX *); 00058 EXTERN char * our_MD5End(MD5_CTX *, char *); 00059 EXTERN char * our_MD5File(const char *, char *); 00060 EXTERN char * our_MD5Data(const unsigned char *, unsigned int, char *); 00061 #endif /* _SYS_MD5_H_ */
1.5.2