blob: f1e93ab3c83b91298f9cde45cad0699fbc0d456d [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/*
2 * Classic "Hello, world" demonstration program
3 *
4 * Copyright (C) 2006-2007 Christophe Devine
5 *
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.
10 *
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.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef _CRT_SECURE_NO_DEPRECATE
22#define _CRT_SECURE_NO_DEPRECATE 1
23#endif
24
25#include <stdio.h>
26
Paul Bakker40e46942009-01-03 21:51:57 +000027#include "polarssl/md5.h"
Paul Bakker5121ce52009-01-03 21:22:43 +000028
29int main( void )
30{
31 int i;
32 unsigned char digest[16];
33 char str[] = "Hello, world!";
34
35 printf( "\n MD5('%s') = ", str );
36
37 md5( (unsigned char *) str, 13, digest );
38
39 for( i = 0; i < 16; i++ )
40 printf( "%02x", digest[i] );
41
42 printf( "\n\n" );
43
44#ifdef WIN32
45 printf( " Press Enter to exit this program.\n" );
46 fflush( stdout ); getchar();
47#endif
48
49 return( 0 );
50}