From 610e594a501d3419e0b8a1bac061ca1af689d531 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 12 Mar 2018 16:16:20 -0700 Subject: Speed tweaks for signatures, etc. --- selftest.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'selftest.cpp') diff --git a/selftest.cpp b/selftest.cpp index 03f587b0..4008cd2a 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -376,11 +376,11 @@ static int testCrypto() C25519::Pair bp[8]; for(int k=0;k<8;++k) bp[k] = C25519::generate(); - const uint64_t st = OSUtils::now(); + uint64_t st = OSUtils::now(); for(unsigned int k=0;k<50;++k) { C25519::agree(bp[~k & 7],bp[k & 7].pub,buf1,64); } - const uint64_t et = OSUtils::now(); + uint64_t et = OSUtils::now(); std::cout << ((double)(et - st) / 50.0) << "ms per agreement." << std::endl; std::cout << "[crypto] Testing Ed25519 ECC signatures... "; std::cout.flush(); @@ -419,6 +419,15 @@ static int testCrypto() } std::cout << "PASS" << std::endl; + std::cout << "[crypto] Benchmarking Ed25519 ECC signatures... "; std::cout.flush(); + st = OSUtils::now(); + for(int k=0;k<1000;++k) { + C25519::Signature sig; + C25519::sign(didntSign.priv,didntSign.pub,buf1,sizeof(buf1),sig.data); + } + et = OSUtils::now(); + std::cout << ((double)(et - st) / 50.0) << "ms per signature." << std::endl; + return 0; } -- cgit v1.2.3