summaryrefslogtreecommitdiff
path: root/selftest.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2018-03-19 11:18:54 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2018-03-19 11:18:54 -0700
commit209f6d9d2d6f826fa37ca841ef51c5d6e065ff5e (patch)
tree181342018acb72d37ddc57412a4727d168345a89 /selftest.cpp
parentb601041b5bd82aca1e52967c37c78ed953be7751 (diff)
parent916077012ed4810492d6e45ed07222cdbb750fc0 (diff)
downloadinfinitytier-209f6d9d2d6f826fa37ca841ef51c5d6e065ff5e.tar.gz
infinitytier-209f6d9d2d6f826fa37ca841ef51c5d6e065ff5e.zip
Merge branch 'dev' into edge
Diffstat (limited to 'selftest.cpp')
-rw-r--r--selftest.cpp13
1 files changed, 11 insertions, 2 deletions
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;
}