From f3c1f6650707f5b923596c47e30494b6f40b2518 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Thu, 29 Sep 2011 13:18:35 +0200 Subject: Allow benchmarking the software version of ciphers. --- src/benchmark-cipher.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/benchmark-cipher.c') diff --git a/src/benchmark-cipher.c b/src/benchmark-cipher.c index d43bc0cd1f..534af75f1c 100644 --- a/src/benchmark-cipher.c +++ b/src/benchmark-cipher.c @@ -202,13 +202,15 @@ mac_bench (int algo, int size) free (_key); } -void benchmark_cipher (int debug_level) +void benchmark_cipher (int init, int debug_level) { gnutls_global_set_log_function (tls_log_func); gnutls_global_set_log_level (debug_level); - gnutls_global_init (); - - gnutls_rnd( GNUTLS_RND_NONCE, data, sizeof(data)); + if (init) + { + gnutls_global_init (); + gnutls_rnd( GNUTLS_RND_NONCE, data, sizeof(data)); + } cipher_bench ( GNUTLS_CIPHER_AES_128_GCM, 16, 1); cipher_mac_bench ( GNUTLS_CIPHER_AES_128_CBC, GNUTLS_MAC_SHA256, 16); -- cgit v1.2.1