Add benchmark for fixed-DHM with blinding

This commit is contained in:
Manuel Pégourié-Gonnard 2013-09-07 13:05:52 +02:00
parent 1a2012459b
commit ce6352a791

View File

@ -557,6 +557,22 @@ int main( int argc, char *argv[] )
ret |= dhm_calc_secret( &dhm, buf, &olen, NULL, NULL );
}
if( ret != 0 )
printf( "FAILED\n" );
else
printf( "%9lu handshake/s\n", i / 3 );
printf( HEADER_FORMAT, "fixed-DHM-1024" );
fflush( stdout );
set_alarm( 3 );
ret = 0;
for( i = 1; ! alarmed && ! ret ; i++ )
{
olen = sizeof( buf );
ret |= dhm_calc_secret( &dhm, buf, &olen, myrand, NULL );
}
if( ret != 0 )
printf( "FAILED\n" );
else
@ -581,6 +597,22 @@ int main( int argc, char *argv[] )
{
olen = sizeof( buf );
ret |= dhm_make_public( &dhm, dhm.len, buf, dhm.len, myrand, NULL );
ret |= dhm_calc_secret( &dhm, buf, &olen, myrand, NULL );
}
if( ret != 0 )
printf( "FAILED\n" );
else
printf( "%9lu handshake/s\n", i / 3 );
printf( HEADER_FORMAT, "fixed-DHM-2048" );
fflush( stdout );
set_alarm( 3 );
ret = 0;
for( i = 1; ! alarmed && ! ret ; i++ )
{
olen = sizeof( buf );
ret |= dhm_calc_secret( &dhm, buf, &olen, NULL, NULL );
}
@ -610,6 +642,22 @@ int main( int argc, char *argv[] )
ret |= dhm_calc_secret( &dhm, buf, &olen, NULL, NULL );
}
if( ret != 0 )
printf( "FAILED\n" );
else
printf( "%9lu handshake/s\n", i / 3 );
printf( HEADER_FORMAT, "fixed-DHM-3072" );
fflush( stdout );
set_alarm( 3 );
ret = 0;
for( i = 1; ! alarmed && ! ret ; i++ )
{
olen = sizeof( buf );
ret |= dhm_calc_secret( &dhm, buf, &olen, myrand, NULL );
}
if( ret != 0 )
printf( "FAILED\n" );
else