From 3a3c3c2a555d6c2b46f330945455bcc11b5184b8 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Mon, 9 Feb 2009 22:33:30 +0000 Subject: [PATCH] - Added SHA-512 benchmark --- programs/test/benchmark.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index b2b009010..6a1d7890a 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -143,6 +143,22 @@ int main( void ) ( hardclock() - tsc ) / ( j * BUFSIZE ) ); #endif +#if defined(POLARSSL_SHA4_C) + printf( " SHA-512 : " ); + fflush( stdout ); + + set_alarm( 1 ); + for( i = 1; ! alarmed; i++ ) + sha4( buf, BUFSIZE, tmp, 0 ); + + tsc = hardclock(); + for( j = 0; j < 1024; j++ ) + sha4( buf, BUFSIZE, tmp, 0 ); + + printf( "%9lu Kb/s, %9lu cycles/byte\n", i * BUFSIZE / 1024, + ( hardclock() - tsc ) / ( j * BUFSIZE ) ); +#endif + #if defined(POLARSSL_ARC4_C) printf( " ARC4 : " ); fflush( stdout );