From 58726498f100b4f7c280bd74c6ab67cf1db04afd Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 2 Jan 2018 00:15:34 -0500 Subject: [PATCH] Clear clang-tidy warnings --- eccrypto.cpp | 6 ++---- rc6.cpp | 1 - rng.cpp | 4 +++- validat1.cpp | 7 +++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/eccrypto.cpp b/eccrypto.cpp index fde92859..9909e6ff 100644 --- a/eccrypto.cpp +++ b/eccrypto.cpp @@ -100,9 +100,8 @@ template<> struct EcRecommendedParameters }; OID oid; - unsigned int t0, t1, t2, t3, t4; const char *a, *b, *g, *n; - unsigned int h; + unsigned int h, t0, t1, t2, t3, t4; }; template<> struct EcRecommendedParameters @@ -118,8 +117,7 @@ template<> struct EcRecommendedParameters }; OID oid; - const char *p; - const char *a, *b, *g, *n; + const char *p, *a, *b, *g, *n; unsigned int h; }; diff --git a/rc6.cpp b/rc6.cpp index 6301cb74..a03c5108 100644 --- a/rc6.cpp +++ b/rc6.cpp @@ -87,7 +87,6 @@ void RC6::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byt a = rotrMod(a-sptr[0], u) ^ t; } - sptr -= 2; d -= sTable[1]; b -= sTable[0]; diff --git a/rng.cpp b/rng.cpp index 9a09b59c..7b0e7382 100644 --- a/rng.cpp +++ b/rng.cpp @@ -85,7 +85,9 @@ X917RNG::X917RNG(BlockTransformation *c, const byte *seed, const byte *determini } // for FIPS 140-2 - GenerateBlock(m_lastBlock, m_size); + // GenerateBlock(m_lastBlock, m_size); + ArraySink target(m_lastBlock, m_size); + GenerateIntoBufferedTransformation(target, DEFAULT_CHANNEL, m_size); } void X917RNG::GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword size) diff --git a/validat1.cpp b/validat1.cpp index c47ad44f..5c67f0c7 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -2782,10 +2782,9 @@ bool ValidateSerpent() std::cout << (pass1 && pass2 ? "passed:" : "FAILED:") << " Algorithm key lengths\n"; FileSource valdata(CRYPTOPP_DATA_DIR "TestData/serpentv.dat", true, new HexDecoder); - bool pass = true; - pass = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 5) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 4) && pass; - pass = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 3) && pass; + pass3 = BlockTransformationTest(FixedRoundsCipherFactory(16), valdata, 5) && pass3; + pass3 = BlockTransformationTest(FixedRoundsCipherFactory(24), valdata, 4) && pass3; + pass3 = BlockTransformationTest(FixedRoundsCipherFactory(32), valdata, 3) && pass3; return pass1 && pass2 && pass3; }