1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2004-2005 the VideoLAN team
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Sam Hocevar <sam@zoy.org>
10 * Adapted to Rockbox by: Antoine Cellerier <dionoea at videolan dot org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
30 /*****************************************************************************
31 * md5_s: MD5 message structure
32 *****************************************************************************
33 * This structure stores the static information needed to compute an MD5
34 * hash. It has an extra data buffer to allow non-aligned writes.
35 *****************************************************************************/
38 uint64_t i_bits
; /* Total written bits */
39 uint32_t p_digest
[4]; /* The MD5 digest */
40 uint32_t p_data
[16]; /* Buffer to cache non-aligned writes */
43 void InitMD5( struct md5_s
* );
44 void AddMD5( struct md5_s
*, const void *, size_t );
45 void EndMD5( struct md5_s
* );
48 * Returns a char representation of the md5 hash, as shown by UNIX md5 or
51 #define MD5_STRING_LENGTH 32
52 void psz_md5_hash( char *, struct md5_s
* );