00001 00002 #ifndef _MD5_H 00003 #define _MD5_H 00004 00005 /* 00006 * RFC 1321 compliant MD5 implementation 00007 * 00008 * Copyright (C) 2001-2003 Christophe Devine 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 00033 #ifndef uint8 00034 #define uint8 unsigned char 00035 #endif 00036 00037 #ifndef uint32 00038 #define uint32 unsigned long int 00039 #endif 00040 00041 typedef struct 00042 { 00043 uint32 total[2]; 00044 uint32 state[4]; 00045 uint8 buffer[64]; 00046 } 00047 md5_context; 00048 00049 void md5_starts( md5_context *ctx ); 00050 void md5_update( md5_context *ctx, const uint8 *input, uint32 length ); 00051 void md5_finish( md5_context *ctx, uint8 digest[16] ); 00052 00053 /* take a string, return the digest as a hex string. Added by Russell Leighton 11/04 */ 00054 void md5_hex(const char *string, char hexdigest[33]); 00055 00056 #endif /* md5.h */