1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright © 2004-2011 VLC authors and VideoLAN
6 * Authors: Rémi Denis-Courmont
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
29 * This file defines functions and structures to compute MD5 digests
34 uint32_t A
, B
, C
, D
; /* chaining variables */
40 VLC_API
void InitMD5( struct md5_s
* );
41 VLC_API
void AddMD5( struct md5_s
*, const void *, size_t );
42 VLC_API
void EndMD5( struct md5_s
* );
45 * Returns a char representation of the md5 hash, as shown by UNIX md5 or
48 static inline char * psz_md5_hash( struct md5_s
*md5_s
)
50 char *psz
= malloc( 33 ); /* md5 string is 32 bytes + NULL character */
53 for( int i
= 0; i
< 16; i
++ )
54 sprintf( &psz
[2*i
], "%02"PRIx8
, md5_s
->buf
[i
] );