From b4c4c5aa14c7514888b40831570e243b74a64073 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 24 Oct 2018 15:34:54 -0400 Subject: Add SSSE3 rotates when available This change obtains the remaining 0.1 to 0.15 cpb. It should be engaged with -march=native --- chacha.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'chacha.cpp') diff --git a/chacha.cpp b/chacha.cpp index 080ccbfd..23fd3be8 100644 --- a/chacha.cpp +++ b/chacha.cpp @@ -33,10 +33,6 @@ std::string ChaCha_Policy::AlgorithmProvider() const #if (CRYPTOPP_SSE2_INTRIN_AVAILABLE || CRYPTOPP_SSE2_ASM_AVAILABLE) if (HasSSE2()) return "SSE2"; -#endif -#if (CRYPTOPP_ARM_NEON_AVAILABLE) - if (HasNEON()) - return "NEON"; #endif return "C++"; } @@ -95,11 +91,6 @@ unsigned int ChaCha_Policy::GetOptimalBlockSize() const if (HasSSE2()) 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; } -- cgit v1.2.1