From: Martin Willi Date: Thu, 19 Aug 2010 10:17:03 +0000 (+0200) Subject: Give a benchmark point for each operation to compare different transforms X-Git-Tag: 4.5.0~448 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d3e174a1e84508c1b0faa5711b452a10d38cd17;p=thirdparty%2Fstrongswan.git Give a benchmark point for each operation to compare different transforms --- diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 79703830c8..d17485ff2f 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -151,6 +151,7 @@ static u_int bench_crypter(private_crypto_tester_t *this, while (end_timing(&start) < this->bench_time) { crypter->encrypt(crypter, buf, chunk_from_thing(iv), NULL); + runs++; crypter->decrypt(crypter, buf, chunk_from_thing(iv), NULL); runs++; } @@ -295,9 +296,10 @@ static u_int bench_aead(private_crypto_tester_t *this, { aead->encrypt(aead, buf, chunk_from_thing(assoc), chunk_from_thing(iv), NULL); + runs += 2; aead->decrypt(aead, chunk_create(buf.ptr, buf.len + icv), chunk_from_thing(assoc), chunk_from_thing(iv), NULL); - runs++; + runs += 2; } free(buf.ptr); aead->destroy(aead); @@ -444,6 +446,7 @@ static u_int bench_signer(private_crypto_tester_t *this, while (end_timing(&start) < this->bench_time) { signer->get_signature(signer, buf, mac); + runs++; signer->verify_signature(signer, buf, chunk_from_thing(mac)); runs++; }