From 253f1ba5dae248cd194619487a33574a1849e7ad Mon Sep 17 00:00:00 2001 From: orangefour Date: Mon, 22 Oct 2018 13:50:04 +0200 Subject: [PATCH] Fix unused variable warnings (GH #723) --- basecode.h | 6 +++--- cmake | 1 + fips140.cpp | 4 +++- rijndael.cpp | 9 --------- 4 files changed, 7 insertions(+), 13 deletions(-) create mode 160000 cmake diff --git a/basecode.h b/basecode.h index 1bfe68d1..f95e3e26 100644 --- a/basecode.h +++ b/basecode.h @@ -61,7 +61,7 @@ public: /// \details padding is set to -1, which means use default padding. If not /// required, then the value must be set via IsolatedInitialize(). BaseN_Decoder(BufferedTransformation *attachment=NULLPTR) - : m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0) + : m_lookup(NULLPTR), m_bitsPerChar(0) , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) {Detach(attachment);} @@ -74,7 +74,7 @@ public: /// \details padding is set to -1, which means use default padding. If not /// required, then the value must be set via IsolatedInitialize(). BaseN_Decoder(const int *lookup, int log2base, BufferedTransformation *attachment=NULLPTR) - : m_lookup(NULLPTR), m_padding(0), m_bitsPerChar(0) + : m_lookup(NULLPTR), m_bitsPerChar(0) , m_outputBlockSize(0), m_bytePos(0), m_bitPos(0) { Detach(attachment); @@ -98,7 +98,7 @@ public: private: const int *m_lookup; - int m_padding, m_bitsPerChar, m_outputBlockSize; + int m_bitsPerChar, m_outputBlockSize; int m_bytePos, m_bitPos; SecByteBlock m_outBuf; }; diff --git a/cmake b/cmake new file mode 160000 index 00000000..2729870f --- /dev/null +++ b/cmake @@ -0,0 +1 @@ +Subproject commit 2729870f277bd568a8e8183b5ba7799e0c2dbf96 diff --git a/fips140.cpp b/fips140.cpp index 1f911fc5..02e1af6a 100644 --- a/fips140.cpp +++ b/fips140.cpp @@ -35,11 +35,13 @@ PowerUpSelfTestStatus CRYPTOPP_API GetPowerUpSelfTestStatus() { return g_powerUpSelfTestStatus; } - + +#if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 // One variable for all threads for compatibility. Previously this // was a ThreadLocalStorage variable, which is per-thread. Also see // https://github.com/weidai11/cryptopp/issues/208 static bool s_inProgress = false; +#endif bool PowerUpSelfTestInProgressOnThisThread() { diff --git a/rijndael.cpp b/rijndael.cpp index b8bbd6b0..f0e200fb 100644 --- a/rijndael.cpp +++ b/rijndael.cpp @@ -120,15 +120,6 @@ static volatile bool s_TeFilled = false, s_TdFilled = false; ANONYMOUS_NAMESPACE_BEGIN -CRYPTOPP_ALIGN_DATA(16) -const word32 s_one[] = {0, 0, 0, 1<<24}; - -/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ -CRYPTOPP_ALIGN_DATA(16) -const word32 s_rconLE[] = { - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36 -}; - #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 // Determine whether the range between begin and end overlaps