mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 17:18:07 +00:00
- Removed application code from library source file
This commit is contained in:
parent
f3b86c1e62
commit
dbee2cad7d
1 changed files with 0 additions and 49 deletions
|
@ -214,53 +214,4 @@ int havege_rand( void *p_rng )
|
|||
return( ret );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_RAND_TEST)
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
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 <output filename>\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
|
||||
|
|
Loading…
Reference in a new issue