00001 /* 00002 * $Id: md5.h,v 1.3 2005/12/15 20:19:08 ghost666 Exp $ 00003 * 00004 * RFC 1321 compliant MD5 implementation 00005 * 00006 * Copyright (C) 2001-2003 Christophe Devine 00007 * 2005 Piotr 'GhosT' Wydrych 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00022 */ 00023 00024 #ifndef _RSSBGR_MD5_H 00025 #define _RSSBGR_MD5_H 00026 00027 #include <string.h> 00028 #include <stdio.h> 00029 00030 #ifndef uint8 00031 #define uint8 unsigned char 00032 #endif 00033 00034 #ifndef uint32 00035 #define uint32 unsigned long int 00036 #endif 00037 00038 typedef struct 00039 { 00040 uint32 total[2]; 00041 uint32 state[4]; 00042 uint8 buffer[64]; 00043 } 00044 md5_context; 00045 00046 void md5_starts( md5_context *ctx ); 00047 void md5_update( md5_context *ctx, uint8 *input, uint32 length ); 00048 void md5_finish( md5_context *ctx, uint8 digest[16] ); 00049 00050 void md5(char *result, char *data); 00051 00052 #endif /* ifndef _RSSBGR_MD5_H */