From a29b734a0fa9955292a4a2e444dfa33487035577 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 24 Jan 2019 09:46:56 -0500 Subject: [PATCH] Fix AlgorithmProvider for ChaChaTLS --- chacha.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/chacha.cpp b/chacha.cpp index 2df162e0..7d780691 100644 --- a/chacha.cpp +++ b/chacha.cpp @@ -337,6 +337,9 @@ std::string ChaChaTLS_Policy::AlgorithmName() const std::string ChaChaTLS_Policy::AlgorithmProvider() const { + // Disable SIMD until we can generate large block test vectors + // https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4 +#if 0 #if (CRYPTOPP_AVX2_AVAILABLE) if (HasAVX2()) return "AVX2"; @@ -360,6 +363,7 @@ std::string ChaChaTLS_Policy::AlgorithmProvider() const if (HasAltivec()) return "Altivec"; else +#endif #endif return "C++"; } @@ -414,6 +418,9 @@ void ChaChaTLS_Policy::SeekToIteration(lword iterationCount) unsigned int ChaChaTLS_Policy::GetAlignment() const { + // Disable SIMD until we can generate large block test vectors + // https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4 +#if 0 #if (CRYPTOPP_AVX2_AVAILABLE) if (HasAVX2()) return 16; @@ -428,14 +435,15 @@ unsigned int ChaChaTLS_Policy::GetAlignment() const if (HasAltivec()) return 16; else +#endif #endif return GetAlignmentOf(); } unsigned int ChaChaTLS_Policy::GetOptimalBlockSize() const { - // Disable SIMD until we can generate large block test vectors - // https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4 + // Disable SIMD until we can generate large block test vectors + // https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4 #if 0 #if (CRYPTOPP_AVX2_AVAILABLE) if (HasAVX2()) @@ -467,8 +475,8 @@ unsigned int ChaChaTLS_Policy::GetOptimalBlockSize() const void ChaChaTLS_Policy::OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) { - // Disable SIMD until we can generate large block test vectors - // https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4 + // Disable SIMD until we can generate large block test vectors + // https://mailarchive.ietf.org/arch/msg/saag/S0_YjVkzEx2s2bHd8KIzjK1CwZ4 #if 0 #if (CRYPTOPP_AVX2_AVAILABLE) if (HasAVX2())