00001 /* 00002 * $Id: md5.h 4972 2008-09-22 17:06:17Z henningw $ 00003 * 00004 * MD5C.H - RSA Data Security, Inc., MD5 message-digest algorithm 00005 * 00006 * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 00007 * rights reserved. 00008 * 00009 * License to copy and use this software is granted provided that it 00010 * is identified as the "RSA Data Security, Inc. MD5 Message-Digest 00011 * Algorithm" in all material mentioning or referencing this software 00012 * or this function. 00013 * 00014 * License is also granted to make and use derivative works provided 00015 * that such works are identified as "derived from the RSA Data 00016 * Security, Inc. MD5 Message-Digest Algorithm" in all material 00017 * mentioning or referencing the derived work. 00018 * 00019 * RSA Data Security, Inc. makes no representations concerning either 00020 * the merchantability of this software or the suitability of this 00021 * software for any particular purpose. It is provided "as is" 00022 * without express or implied warranty of any kind. 00023 * 00024 * These notices must be retained in any copies of any part of this 00025 * documentation and/or software. 00026 */ 00027 00028 /*! 00029 * \file 00030 * \brief MD5 message-digest algorithm - RSA Data Security, Inc. 00031 */ 00032 00033 00034 #ifndef MD5_H 00035 #define MD5_H 00036 00037 /*! MD5 context. */ 00038 typedef struct { 00039 unsigned int state[4]; /*!< state (ABCD) */ 00040 unsigned int count[2]; /*!< number of bits, modulo 2^64 (lsb first) */ 00041 unsigned char buffer[64]; /*!< input buffer */ 00042 } MD5_CTX; 00043 00044 void MD5Init (MD5_CTX *); 00045 void U_MD5Update (MD5_CTX *, unsigned char *, unsigned int); 00046 void U_MD5Final (unsigned char [16], MD5_CTX *); 00047 00048 00049 /*! 00050 * \brief Small wrapper around MD5Update 00051 * 00052 * Small wrapper around MD5Update, because everybody uses this on 'str' types 00053 * \param context MD5 context 00054 * \param input input block 00055 * \param inputLen length of input block 00056 * \note please not use this in new code 00057 * \todo review and fix all wrong usage 00058 */ 00059 static inline void MD5Update (MD5_CTX *context, char *input, unsigned int inputLen) 00060 { 00061 return U_MD5Update(context, (unsigned char *)input, inputLen); 00062 } 00063 00064 00065 /*! 00066 * \brief Small wrapper around MD5Final 00067 * 00068 * Small wrapper around MD5Final, because everybody uses this on 'str' types 00069 * \param digest message digest 00070 * \param context MD5 context 00071 * \note please not use this in new code 00072 * \todo review and fix all wrong usage 00073 */ 00074 static inline void MD5Final (char digest[16], MD5_CTX *context) 00075 { 00076 U_MD5Final((unsigned char *)digest, context); 00077 } 00078 00079 #endif /* MD5_H */
1.5.6