From dbee2cad7de7658eed0cdc041980483cbc1ff61a Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Thu, 27 Jan 2011 16:38:52 +0000 Subject: [PATCH] - Removed application code from library source file --- library/havege.c | 49 ------------------------------------------------ 1 file changed, 49 deletions(-) diff --git a/library/havege.c b/library/havege.c index 6e2d747ef..d3981d9d4 100644 --- a/library/havege.c +++ b/library/havege.c @@ -214,53 +214,4 @@ int havege_rand( void *p_rng ) return( ret ); } -#if defined(POLARSSL_RAND_TEST) - -#include - -int main( int argc, char *argv[] ) -{ - FILE *f; - time_t t; - int i, j, k; - havege_state hs; - unsigned char buf[1024]; - - if( argc < 2 ) - { - fprintf( stderr, "usage: %s \n", argv[0] ); - return( 1 ); - } - - if( ( f = fopen( argv[1], "wb+" ) ) == NULL ) - { - printf( "failed to open '%s' for writing.\n", argv[0] ); - return( 1 ); - } - - havege_init( &hs ); - - t = time( NULL ); - - for( i = 0, k = 32768; i < k; i++ ) - { - for( j = 0; j < sizeof( buf ); j++ ) - buf[j] = havege_rand( &hs ); - - fwrite( buf, sizeof( buf ), 1, f ); - - printf( "Generating 32Mb of data in file '%s'... %04.1f" \ - "%% done\r", argv[1], (100 * (float) (i + 1)) / k ); - fflush( stdout ); - } - - if( t == time( NULL ) ) - t--; - - fclose( f ); - return( 0 ); -} - -#endif - #endif