2 * RFC 1321 compliant MD5 implementation
4 * Copyright (C) 2006-2007 Christophe Devine
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * \brief MD5 context structure
28 unsigned long total
[2]; /*!< number of bytes processed */
29 unsigned long state
[4]; /*!< intermediate digest state */
30 unsigned char buffer
[64]; /*!< data block being processed */
35 * \brief Output = MD5( input buffer )
37 * \param input buffer holding the data
38 * \param ilen length of the input data
39 * \param output MD5 checksum result
41 void md5( unsigned char *input
, int ilen
, unsigned char output
[16] );
44 * \brief Output = MD5( file contents )
46 * \param path input file name
47 * \param output MD5 checksum result
49 * \return 0 if successful, 1 if fopen failed,
50 * or 2 if fread failed
52 int md5_file( const char *path
, unsigned char output
[16] );