diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-18 12:59:04 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-18 12:59:04 -0800 |
commit | 2ea9f516e121ea6eb344a8d180a739a1d707aecb (patch) | |
tree | 5d1e02ed53e797f277de06f18fc64626cebe737e /selftest.cpp | |
parent | ab4021dd0ee37af0af4137dc772911ea8ec52bb2 (diff) | |
download | infinitytier-2ea9f516e121ea6eb344a8d180a739a1d707aecb.tar.gz infinitytier-2ea9f516e121ea6eb344a8d180a739a1d707aecb.zip |
Rate gate expensive validation of new identities in HELLO.
Diffstat (limited to 'selftest.cpp')
-rw-r--r-- | selftest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/selftest.cpp b/selftest.cpp index 9992d757..adac2f58 100644 --- a/selftest.cpp +++ b/selftest.cpp @@ -327,6 +327,17 @@ static int testCrypto() } std::cout << "PASS" << std::endl; + std::cout << "[crypto] Benchmarking C25519 ECC key agreement... "; std::cout.flush(); + C25519::Pair bp[8]; + for(int k=0;k<8;++k) + bp[k] = C25519::generate(); + const 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(); + std::cout << ((double)(et - st) / 50.0) << "ms per agreement." << std::endl; + std::cout << "[crypto] Testing Ed25519 ECC signatures... "; std::cout.flush(); C25519::Pair didntSign = C25519::generate(); for(unsigned int i=0;i<10;++i) { |