summaryrefslogtreecommitdiff
path: root/chacha.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-10-24 15:34:54 -0400
committerJeffrey Walton <noloader@gmail.com>2018-10-24 15:34:54 -0400
commitb4c4c5aa14c7514888b40831570e243b74a64073 (patch)
treed648b2d42ba4bb735eb7e5ff776cb5c331d5daf5 /chacha.cpp
parentc43c47e59002242628dc5534ab8dce786d0892c1 (diff)
downloadcryptopp-git-b4c4c5aa14c7514888b40831570e243b74a64073.tar.gz
Add SSSE3 rotates when available
This change obtains the remaining 0.1 to 0.15 cpb. It should be engaged with -march=native
Diffstat (limited to 'chacha.cpp')
-rw-r--r--chacha.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/chacha.cpp b/chacha.cpp
index 080ccbfd..23fd3be8 100644
--- a/chacha.cpp
+++ b/chacha.cpp
@@ -34,10 +34,6 @@ std::string ChaCha_Policy::AlgorithmProvider() const
if (HasSSE2())
return "SSE2";
#endif
-#if (CRYPTOPP_ARM_NEON_AVAILABLE)
- if (HasNEON())
- return "NEON";
-#endif
return "C++";
}
@@ -96,11 +92,6 @@ unsigned int ChaCha_Policy::GetOptimalBlockSize() const
return 4*BYTES_PER_ITERATION;
else
#endif
-#if (CRYPTOPP_ARM_NEON_AVAILABLE)
- if (HasNEON())
- return 4*BYTES_PER_ITERATION;
- else
-#endif
return BYTES_PER_ITERATION;
}
@@ -122,7 +113,7 @@ void ChaCha_Policy::OperateKeystream(KeystreamOperation operation,
if (m_state[12] < 4)
m_state[13]++;
- input += 4*BYTES_PER_ITERATION;
+ input += !!xorInput*4*BYTES_PER_ITERATION;
output += 4*BYTES_PER_ITERATION;
iterationCount -= 4;
}