diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index 401c83727..e0d65d33d 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -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