diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-09-29 13:18:35 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-09-29 13:18:35 +0200 |
commit | f3c1f6650707f5b923596c47e30494b6f40b2518 (patch) | |
tree | bf8062d5a8127348b2555f9c49a6aaa17bcbe9cb /src/benchmark-cipher.c | |
parent | 3edaf986b6dd126397cede1f23d3c35edb5452ae (diff) | |
download | gnutls-f3c1f6650707f5b923596c47e30494b6f40b2518.tar.gz |
Allow benchmarking the software version of ciphers.
Diffstat (limited to 'src/benchmark-cipher.c')
-rw-r--r-- | src/benchmark-cipher.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); |