summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-07-06 13:51:25 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-07-06 13:51:25 -0700
commitfeddd946f9d3ac6a643968582610eb4ffaebb69d (patch)
tree9660a442c5b76d6cb9722a1febcbfd5e9b3c777b
parent6bfbc43e3c1de27648c974fc783573487391e0a2 (diff)
downloadinfinitytier-feddd946f9d3ac6a643968582610eb4ffaebb69d.tar.gz
infinitytier-feddd946f9d3ac6a643968582610eb4ffaebb69d.zip
For curiosity add Salsa20/8 to benchmarks.
-rw-r--r--node/RemotePath.hpp (renamed from node/Path.hpp)0
-rw-r--r--selftest.cpp18
2 files changed, 18 insertions, 0 deletions
diff --git a/node/Path.hpp b/node/RemotePath.hpp
index 393b7225..393b7225 100644
--- a/node/Path.hpp
+++ b/node/RemotePath.hpp
diff --git a/selftest.cpp b/selftest.cpp
index 27c81c25..f84abcc0 100644
--- a/selftest.cpp
+++ b/selftest.cpp
@@ -193,6 +193,24 @@ static int testCrypto()
std::cout << "[crypto] Salsa20 SSE: DISABLED" << std::endl;
#endif
+ std::cout << "[crypto] Benchmarking Salsa20/8... "; std::cout.flush();
+ {
+ unsigned char *bb = (unsigned char *)::malloc(1234567);
+ for(unsigned int i=0;i<1234567;++i)
+ bb[i] = (unsigned char)i;
+ Salsa20 s20(s20TV0Key,256,s20TV0Iv,8);
+ double bytes = 0.0;
+ uint64_t start = OSUtils::now();
+ for(unsigned int i=0;i<200;++i) {
+ s20.encrypt(bb,bb,1234567);
+ bytes += 1234567.0;
+ }
+ uint64_t end = OSUtils::now();
+ SHA512::hash(buf1,bb,1234567);
+ std::cout << ((bytes / 1048576.0) / ((double)(end - start) / 1000.0)) << " MiB/second (" << Utils::hex(buf1,16) << ')' << std::endl;
+ ::free((void *)bb);
+ }
+
std::cout << "[crypto] Benchmarking Salsa20/12... "; std::cout.flush();
{
unsigned char *bb = (unsigned char *)::malloc(1234567);