summaryrefslogtreecommitdiff
path: root/selftest.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-07 13:35:46 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-07 13:35:46 -0700
commite5f168f599ba053ee5e6029387dd7ad4b95a7d28 (patch)
treecb395791a3689ebe8d39691663e8fb9870348f5c /selftest.cpp
parent7d62dbe9f7fa620982c71f44089d319120023e26 (diff)
downloadinfinitytier-e5f168f599ba053ee5e6029387dd7ad4b95a7d28.tar.gz
infinitytier-e5f168f599ba053ee5e6029387dd7ad4b95a7d28.zip
Add proof of work request for future DDOS mitigation use.
Diffstat (limited to 'selftest.cpp')
-rw-r--r--selftest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/selftest.cpp b/selftest.cpp
index e938cf4d..090839ee 100644
--- a/selftest.cpp
+++ b/selftest.cpp
@@ -52,6 +52,7 @@
#include "node/CertificateOfMembership.hpp"
#include "node/Defaults.hpp"
#include "node/Node.hpp"
+#include "node/IncomingPacket.hpp"
#include "osdep/OSUtils.hpp"
#include "osdep/Phy.hpp"
@@ -285,6 +286,19 @@ static int testCrypto()
::free((void *)bb);
}
+ /*
+ for(unsigned int d=8;d<=10;++d) {
+ for(int k=0;k<8;++k) {
+ std::cout << "[crypto] computeSalsa2012Sha512ProofOfWork(" << d << ",\"foobarbaz\",9) == "; std::cout.flush();
+ unsigned char result[16];
+ uint64_t start = OSUtils::now();
+ IncomingPacket::computeSalsa2012Sha512ProofOfWork(d,"foobarbaz",9,result);
+ uint64_t end = OSUtils::now();
+ std::cout << Utils::hex(result,16) << " -- valid: " << IncomingPacket::testSalsa2012Sha512ProofOfWorkResult(d,"foobarbaz",9,result) << ", " << (end - start) << "ms" << std::endl;
+ }
+ }
+ */
+
std::cout << "[crypto] Testing C25519 and Ed25519 against test vectors... "; std::cout.flush();
for(int k=0;k<ZT_NUM_C25519_TEST_VECTORS;++k) {
C25519::Pair p1,p2;