From a0e21c77aeadb2d8bb4c03a830528c9ae0616dfe Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 26 Apr 2021 04:50:48 -0400 Subject: Add LSH dynamic dispatch (PR #1032) This commit adds dynamic dispatch to LSH. The implementation pivots on AVX2 and SSSE3. --- datatest.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'datatest.cpp') diff --git a/datatest.cpp b/datatest.cpp index cea57f79..f3a8766f 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -241,15 +241,15 @@ void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransfo } else if (s1.substr(0, 2) == "0x") { - std::string::size_type pos = s1.find(' '); - StringSource(s1.substr(2, pos), true, new HexDecoder(new StringSink(s2))); - s1 = s1.substr(STDMIN(pos, s1.length())); + std::string::size_type n = s1.find(' '); + StringSource(s1.substr(2, n), true, new HexDecoder(new StringSink(s2))); + s1 = s1.substr(STDMIN(n, s1.length())); } else { - std::string::size_type pos = s1.find(' '); - StringSource(s1.substr(0, pos), true, new HexDecoder(new StringSink(s2))); - s1 = s1.substr(STDMIN(pos, s1.length())); + std::string::size_type n = s1.find(' '); + StringSource(s1.substr(0, n), true, new HexDecoder(new StringSink(s2))); + s1 = s1.substr(STDMIN(n, s1.length())); } while (repeat--) @@ -850,8 +850,8 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri if (encrypted != ciphertext) { std::cout << "\nincorrectly encrypted: "; - StringSource ss(encrypted, false, new HexEncoder(new FileSink(std::cout))); - ss.Pump(2048); ss.Flush(false); + StringSource sss(encrypted, false, new HexEncoder(new FileSink(std::cout))); + sss.Pump(2048); sss.Flush(false); std::cout << "\n"; SignalTestFailure(); } @@ -867,8 +867,8 @@ void TestSymmetricCipherWithFileSource(TestData &v, const NameValuePairs &overri if (decrypted != plaintext) { std::cout << "\nincorrectly decrypted: "; - StringSource ss(decrypted, false, new HexEncoder(new FileSink(std::cout))); - ss.Pump(256); ss.Flush(false); + StringSource sss(decrypted, false, new HexEncoder(new FileSink(std::cout))); + sss.Pump(256); sss.Flush(false); std::cout << "\n"; SignalTestFailure(); } -- cgit v1.2.1