summaryrefslogtreecommitdiff
path: root/chacha.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-11-14 08:19:13 -0500
committerJeffrey Walton <noloader@gmail.com>2018-11-14 08:19:13 -0500
commit225ab6cb7be252135d43b275fb0b2447036985ea (patch)
treeff0000fc8bc10081c132ef1655696170dcc4d462 /chacha.cpp
parentb3941a433db3f6b26b66b7db67580a0ecd97ae09 (diff)
downloadcryptopp-git-225ab6cb7be252135d43b275fb0b2447036985ea.tar.gz
Drop ChaCha requirements to POWER7
This costs about 0.6 cpb (700 MB/s on GCC112), but it makes the faster algorithm available to more machines. In the future we may want to provide both POWER7 and POWER8
Diffstat (limited to 'chacha.cpp')
-rw-r--r--chacha.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/chacha.cpp b/chacha.cpp
index fe438507..333a58a6 100644
--- a/chacha.cpp
+++ b/chacha.cpp
@@ -24,8 +24,8 @@ extern void ChaCha_OperateKeystream_SSE2(const word32 *state, const byte* input,
extern void ChaCha_OperateKeystream_AVX2(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
-#if (CRYPTOPP_POWER8_AVAILABLE)
-extern void ChaCha_OperateKeystream_POWER8(const word32 *state, const byte* input, byte *output, unsigned int rounds);
+#if (CRYPTOPP_POWER7_AVAILABLE)
+extern void ChaCha_OperateKeystream_POWER7(const word32 *state, const byte* input, byte *output, unsigned int rounds);
#endif
#define CHACHA_QUARTER_ROUND(a,b,c,d) \
@@ -81,9 +81,9 @@ std::string ChaCha_Policy::AlgorithmProvider() const
return "NEON";
else
#endif
-#if (CRYPTOPP_POWER8_AVAILABLE)
- if (HasPower8())
- return "Power8";
+#if (CRYPTOPP_POWER7_AVAILABLE)
+ if (HasPower7())
+ return "Power7";
else
#endif
return "C++";
@@ -139,8 +139,8 @@ unsigned int ChaCha_Policy::GetAlignment() const
return 16;
else
#endif
-#if (CRYPTOPP_POWER8_AVAILABLE)
- if (HasPower8())
+#if (CRYPTOPP_POWER7_AVAILABLE)
+ if (HasPower7())
return 16;
else
#endif
@@ -164,8 +164,8 @@ unsigned int ChaCha_Policy::GetOptimalBlockSize() const
return 4*BYTES_PER_ITERATION;
else
#endif
-#if (CRYPTOPP_POWER8_AVAILABLE)
- if (HasPower8())
+#if (CRYPTOPP_POWER7_AVAILABLE)
+ if (HasPower7())
return 4*BYTES_PER_ITERATION;
else
#endif
@@ -245,13 +245,13 @@ void ChaCha_Policy::OperateKeystream(KeystreamOperation operation,
}
#endif
-#if (CRYPTOPP_POWER8_AVAILABLE)
- if (HasPower8())
+#if (CRYPTOPP_POWER7_AVAILABLE)
+ if (HasPower7())
{
while (iterationCount >= 4 && MultiBlockSafe(4))
{
const bool xorInput = (operation & INPUT_NULL) != INPUT_NULL;
- ChaCha_OperateKeystream_POWER8(m_state, xorInput ? input : NULLPTR, output, m_rounds);
+ ChaCha_OperateKeystream_POWER7(m_state, xorInput ? input : NULLPTR, output, m_rounds);
// MultiBlockSafe avoids overflow on the counter words
m_state[12] += 4;