summaryrefslogtreecommitdiff
path: root/node/IncomingPacket.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-09 09:39:27 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-09 09:39:27 -0700
commit0c498556d5b11c101d2b18cf85cff2d53aa97d58 (patch)
tree8b486cb833c74dc48f03218060ed6c4c2e34af7d /node/IncomingPacket.cpp
parent3fa6dd377f479774ae2726f24748f41458329272 (diff)
downloadinfinitytier-0c498556d5b11c101d2b18cf85cff2d53aa97d58.tar.gz
infinitytier-0c498556d5b11c101d2b18cf85cff2d53aa97d58.zip
Unroll Salsa20 fully for a little more speed (non-SSE now almost as fast as SSE)
Diffstat (limited to 'node/IncomingPacket.cpp')
-rw-r--r--node/IncomingPacket.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp
index 0aadc104..5d31a5d4 100644
--- a/node/IncomingPacket.cpp
+++ b/node/IncomingPacket.cpp
@@ -1149,9 +1149,9 @@ try_salsa2012sha512_again:
++*(reinterpret_cast<volatile uint64_t *>(candidate));
SHA512::hash(shabuf,candidate,16 + challengeLength);
- s20.init(shabuf,256,&s20iv,12);
+ s20.init(shabuf,256,&s20iv);
memset(salsabuf,0,sizeof(salsabuf));
- s20.encrypt(salsabuf,salsabuf,sizeof(salsabuf));
+ s20.encrypt12(salsabuf,salsabuf,sizeof(salsabuf));
SHA512::hash(shabuf,salsabuf,sizeof(salsabuf));
d = difficulty;
@@ -1186,9 +1186,9 @@ bool IncomingPacket::testSalsa2012Sha512ProofOfWorkResult(unsigned int difficult
memcpy(candidate + 16,challenge,challengeLength);
SHA512::hash(shabuf,candidate,16 + challengeLength);
- s20.init(shabuf,256,&s20iv,12);
+ s20.init(shabuf,256,&s20iv);
memset(salsabuf,0,sizeof(salsabuf));
- s20.encrypt(salsabuf,salsabuf,sizeof(salsabuf));
+ s20.encrypt12(salsabuf,salsabuf,sizeof(salsabuf));
SHA512::hash(shabuf,salsabuf,sizeof(salsabuf));
d = difficulty;