From feddd946f9d3ac6a643968582610eb4ffaebb69d Mon Sep 17 00:00:00 2001
From: Adam Ierymenko <adam.ierymenko@gmail.com>
Date: Mon, 6 Jul 2015 13:51:25 -0700
Subject: [PATCH] For curiosity add Salsa20/8 to benchmarks.

---
 node/{Path.hpp => RemotePath.hpp} |  0
 selftest.cpp                      | 18 ++++++++++++++++++
 2 files changed, 18 insertions(+)
 rename node/{Path.hpp => RemotePath.hpp} (100%)

diff --git a/node/Path.hpp b/node/RemotePath.hpp
similarity index 100%
rename from node/Path.hpp
rename to node/RemotePath.hpp
diff --git a/selftest.cpp b/selftest.cpp
index 27c81c257..f84abcc0d 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);