diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-09 09:39:27 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-09 09:39:27 -0700 |
commit | 0c498556d5b11c101d2b18cf85cff2d53aa97d58 (patch) | |
tree | 8b486cb833c74dc48f03218060ed6c4c2e34af7d /node/IncomingPacket.cpp | |
parent | 3fa6dd377f479774ae2726f24748f41458329272 (diff) | |
download | infinitytier-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.cpp | 8 |
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; |