mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-25 12:08:48 +00:00
Add benchmark for fixed-DHM with blinding
This commit is contained in:
parent
1a2012459b
commit
ce6352a791
1 changed files with 48 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue