diff --git a/sosemanuk.cpp b/sosemanuk.cpp index 52a02d9b..82cf8c92 100644 --- a/sosemanuk.cpp +++ b/sosemanuk.cpp @@ -21,9 +21,11 @@ NAMESPACE_BEGIN(CryptoPP) std::string SosemanukPolicy::AlgorithmProvider() const { -#if CRYPTOPP_SSE2_ASM_AVAILABLE +#ifndef CRYPTOPP_DISABLE_SOSEMANUK_ASM +# if CRYPTOPP_SSE2_ASM_AVAILABLE if (HasSSE2()) return "SSE2"; +# endif #endif return "C++"; } diff --git a/sosemanuk.h b/sosemanuk.h index 4261f5d6..05b5578c 100644 --- a/sosemanuk.h +++ b/sosemanuk.h @@ -30,6 +30,7 @@ struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterf class SosemanukPolicy : public AdditiveCipherConcretePolicy, public SosemanukInfo { protected: + std::string AlgorithmProvider() const; void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length); void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount); void CipherResynchronize(byte *keystreamBuffer, const byte *iv, size_t length); @@ -39,8 +40,6 @@ protected: unsigned int GetOptimalBlockSize() const; #endif - std::string AlgorithmProvider() const; - FixedSizeSecBlock m_key; FixedSizeAlignedSecBlock m_state; }; diff --git a/tiger.cpp b/tiger.cpp index 77e2a27c..03d2ddb0 100644 --- a/tiger.cpp +++ b/tiger.cpp @@ -16,6 +16,17 @@ NAMESPACE_BEGIN(CryptoPP) +std::string Tiger::AlgorithmProvider() const +{ +#ifndef CRYPTOPP_DISABLE_TIGER_ASM +# if CRYPTOPP_SSE2_ASM_AVAILABLE + if (HasSSE2()) + return "SSE2"; +# endif +#endif + return "C++"; +} + void Tiger::InitState(HashWordType *state) { state[0] = W64LIT(0x0123456789ABCDEF); diff --git a/tiger.h b/tiger.h index a76344f4..b1e632a6 100644 --- a/tiger.h +++ b/tiger.h @@ -24,10 +24,12 @@ NAMESPACE_BEGIN(CryptoPP) class Tiger : public IteratedHashWithStaticTransform { public: + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Tiger";} + std::string AlgorithmProvider() const; + static void InitState(HashWordType *state); static void Transform(word64 *digest, const word64 *data); void TruncatedFinal(byte *hash, size_t size); - CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Tiger";} protected: static const word64 table[4*256+3];