blob: 00f7b8ec7ac6991b9edcb71c5cbda5a1299b9c74 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/*
2 * Classic "Hello, world" demonstration program
3 *
Paul Bakkere0ccd0a2009-01-04 16:27:10 +00004 * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine
5 *
Paul Bakker27db1f52009-01-25 15:27:00 +00006 * Copyright (C) 2009 Paul Bakker <polarssl_maintainer at polarssl dot org>
Paul Bakker5121ce52009-01-03 21:22:43 +00007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#ifndef _CRT_SECURE_NO_DEPRECATE
24#define _CRT_SECURE_NO_DEPRECATE 1
25#endif
26
27#include <stdio.h>
28
Paul Bakker40e46942009-01-03 21:51:57 +000029#include "polarssl/md5.h"
Paul Bakker5121ce52009-01-03 21:22:43 +000030
31int main( void )
32{
33 int i;
34 unsigned char digest[16];
35 char str[] = "Hello, world!";
36
37 printf( "\n MD5('%s') = ", str );
38
39 md5( (unsigned char *) str, 13, digest );
40
41 for( i = 0; i < 16; i++ )
42 printf( "%02x", digest[i] );
43
44 printf( "\n\n" );
45
46#ifdef WIN32
47 printf( " Press Enter to exit this program.\n" );
48 fflush( stdout ); getchar();
49#endif
50
51 return( 0 );
52}