diff --git a/datatest.cpp b/datatest.cpp index 2f9bcb5f..8f33b668 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -116,12 +116,8 @@ void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransfo s1 = s1.substr(s1.find(' ')+1); } - // Convert endian order. Use it with 64-bit words like this: - // Key: word64 BC2560EFC6BBA2B1 E3361F162238EB40 FB8631EE0ABBD175 7B9479D4C5479ED1 - // BC2560EFC6BBA2B1 will be processed into B1A2BBC6EF6025BC. - // or: - // Key: word32 BC2560EF E3361F16 FB8631EE 7B9479D4 - // BC2560EF will be processed into EF6025BC. + // Convert word32 or word64 to little endian order. Some algorithm test vectors are + // presented in the format. We probably should have named them word32le and word64le. if (s1.length() >= 6 && (s1.substr(0,6) == "word32" || s1.substr(0,6) == "word64")) { std::istringstream iss(s1.substr(6)); @@ -489,16 +485,7 @@ void TestSymmetricCipher(TestData &v, const NameValuePairs &overrideParameters) static_cast(paddingScheme)); RandomizedTransfer(StringStore(plaintext).Ref(), encFilter, true); encFilter.MessageEnd(); - /*{ - std::string z; - encryptor->Seek(seek); - StringSource ss(plaintext, false, new StreamTransformationFilter(*encryptor, new StringSink(z), - static_cast(paddingScheme))); - while (ss.Pump(64)) {} - ss.PumpAll(); - for (int i=0; i(iterationCount); } -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SALSA_ASM) +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) unsigned int Salsa20_Policy::GetAlignment() const { #if CRYPTOPP_SSE2_ASM_AVAILABLE diff --git a/salsa.h b/salsa.h index f3bede3b..a491a056 100644 --- a/salsa.h +++ b/salsa.h @@ -12,7 +12,7 @@ // TODO: work around GCC 4.8+ issue with SSE2 ASM until the exact details are known // and fix is released. Duplicate with "valgrind ./cryptest.exe tv salsa" // "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 -#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) || (CRYPTOPP_GCC_VERSION >= 40800) +#if CRYPTOPP_BOOL_X32 || defined(CRYPTOPP_DISABLE_INTEL_ASM) # define CRYPTOPP_DISABLE_SALSA_ASM #endif @@ -22,7 +22,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Salsa20 stream cipher information struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8> { - CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Salsa20";} + static std::string StaticAlgorithmName() {return "Salsa20";} }; //! \class Salsa20_Policy @@ -35,7 +35,7 @@ protected: void CipherResynchronize(byte *keystreamBuffer, const byte *IV, size_t length); bool CipherIsRandomAccess() const {return true;} void SeekToIteration(lword iterationCount); -#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) && !defined(CRYPTOPP_DISABLE_SALSA_ASM) +#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) unsigned int GetAlignment() const; unsigned int GetOptimalBlockSize() const; #endif @@ -58,7 +58,7 @@ struct Salsa20 : public Salsa20_Info, public SymmetricCipherDocumentation //! \brief XSalsa20 stream cipher information struct XSalsa20_Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 24> { - CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "XSalsa20";} + static std::string StaticAlgorithmName() {return "XSalsa20";} }; //! \class XSalsa20_Policy