From b2c5616ede18ac075d0d602dd0bc1f5955fd832e Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 17 Aug 2018 07:49:35 -0400 Subject: [PATCH] Fix AlgorithmProvider for SIMON and SPECK on Solaris --- simon.cpp | 24 ++++++++++++++---------- speck.cpp | 24 ++++++++++++++---------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/simon.cpp b/simon.cpp index 59e74443..83fbd054 100644 --- a/simon.cpp +++ b/simon.cpp @@ -243,17 +243,19 @@ extern size_t SIMON128_Dec_AdvancedProcessBlocks_POWER8(const word64* subKeys, s std::string SIMON64::Base::AlgorithmProvider() const { -#if defined(CRYPTOPP_SSE41_AVAILABLE) +#if (CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS) +# if (CRYPTOPP_SSE41_AVAILABLE) if (HasSSE41()) return "SSE4.1"; -#endif -#if (CRYPTOPP_ARM_NEON_AVAILABLE) +# endif +# if (CRYPTOPP_ARM_NEON_AVAILABLE) if (HasNEON()) return "NEON"; -#endif -#if (CRYPTOPP_POWER7_AVAILABLE) +# endif +# if (CRYPTOPP_POWER7_AVAILABLE) if (HasPower7()) return "Power7"; +# endif #endif return "C++"; } @@ -339,17 +341,19 @@ void SIMON64::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, std::string SIMON128::Base::AlgorithmProvider() const { -#if defined(CRYPTOPP_SSSE3_AVAILABLE) +#if (CRYPTOPP_SIMON128_ADVANCED_PROCESS_BLOCKS) +# if (CRYPTOPP_SSSE3_AVAILABLE) if (HasSSSE3()) return "SSSE3"; -#endif -#if (CRYPTOPP_ARM_NEON_AVAILABLE) +# endif +# if (CRYPTOPP_ARM_NEON_AVAILABLE) if (HasNEON()) return "NEON"; -#endif -#if (CRYPTOPP_POWER8_AVAILABLE) +# endif +# if (CRYPTOPP_POWER8_AVAILABLE) if (HasPower8()) return "Power8"; +# endif #endif return "C++"; } diff --git a/speck.cpp b/speck.cpp index 2915bb2e..9359ae9a 100644 --- a/speck.cpp +++ b/speck.cpp @@ -218,17 +218,19 @@ extern size_t SPECK128_Dec_AdvancedProcessBlocks_POWER8(const word64* subKeys, s std::string SPECK64::Base::AlgorithmProvider() const { -#if defined(CRYPTOPP_SSE41_AVAILABLE) +#if (CRYPTOPP_SPECK64_ADVANCED_PROCESS_BLOCKS) +# if (CRYPTOPP_SSE41_AVAILABLE) if (HasSSE41()) return "SSE4.1"; -#endif -#if (CRYPTOPP_ARM_NEON_AVAILABLE) +# endif +# if (CRYPTOPP_ARM_NEON_AVAILABLE) if (HasNEON()) return "NEON"; -#endif -#if (CRYPTOPP_POWER7_AVAILABLE) +# endif +# if (CRYPTOPP_POWER7_AVAILABLE) if (HasPower7()) return "Power7"; +# endif #endif return "C++"; } @@ -314,17 +316,19 @@ void SPECK64::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, std::string SPECK128::Base::AlgorithmProvider() const { -#if defined(CRYPTOPP_SSSE3_AVAILABLE) +#if (CRYPTOPP_SPECK128_ADVANCED_PROCESS_BLOCKS) +# if (CRYPTOPP_SSSE3_AVAILABLE) if (HasSSSE3()) return "SSSE3"; -#endif -#if (CRYPTOPP_ARM_NEON_AVAILABLE) +# endif +# if (CRYPTOPP_ARM_NEON_AVAILABLE) if (HasNEON()) return "NEON"; -#endif -#if (CRYPTOPP_POWER8_AVAILABLE) +# endif +# if (CRYPTOPP_POWER8_AVAILABLE) if (HasPower8()) return "Power8"; +# endif #endif return "C++"; }