00001 /*!@file Util/md5.H general md5 (128-bit) message-digest implementation */ 00002 00003 // This code is from http://www.cr0.net:8040/code/crypto/md5/, also 00004 // under the GPL (see original copyright notice below) 00005 00006 /* 00007 * RFC 1321 compliant MD5 implementation 00008 * 00009 * Copyright (C) 2001-2003 Christophe Devine 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 */ 00025 00026 // 00027 // Primary maintainer for this file: Rob Peters <rjpeters at usc dot edu> 00028 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Util/md5.H $ 00029 // $Id: md5.H 5367 2005-08-22 21:45:50Z rjpeters $ 00030 // 00031 00032 #ifndef UTIL_MD5_H_DEFINED 00033 #define UTIL_MD5_H_DEFINED 00034 00035 #include "Util/Types.H" 00036 00037 struct md5_context 00038 { 00039 uint32 total[2]; 00040 uint32 state[4]; 00041 byte buffer[64]; 00042 }; 00043 00044 void md5_starts( md5_context* ctx ); 00045 void md5_update( md5_context* ctx, const byte* input, uint32 length ); 00046 void md5_finish( md5_context* ctx, byte digest[16] ); 00047 00048 // ###################################################################### 00049 /* So things look consistent in everyone's emacs... */ 00050 /* Local Variables: */ 00051 /* indent-tabs-mode: nil */ 00052 /* End: */ 00053 00054 #endif // UTIL_MD5_H_DEFINED