From 2623d24f5cf25094140ac2a61443ec84fb9bb839 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 12 Nov 2017 13:10:22 -0500 Subject: [PATCH] Update documentation Removed defined-out code --- cryptlib.cpp | 25 ------------------------- cryptlib.h | 22 +++++++++------------- 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/cryptlib.cpp b/cryptlib.cpp index b6e91f07..a9722159 100644 --- a/cryptlib.cpp +++ b/cryptlib.cpp @@ -42,16 +42,6 @@ CRYPTOPP_COMPILE_ASSERT(sizeof(word64) == 8); CRYPTOPP_COMPILE_ASSERT(sizeof(dword) == 2*sizeof(word)); #endif -#if 0 -class NullNameValuePairs : public NameValuePairs -{ -public: - NullNameValuePairs() {} // Clang complains a default ctor must be avilable - bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const - {CRYPTOPP_UNUSED(name); CRYPTOPP_UNUSED(valueType); CRYPTOPP_UNUSED(pValue); return false;} -}; -#endif - BufferedTransformation & TheBitBucket() { static BitBucket bitBucket; @@ -319,11 +309,6 @@ void RandomNumberGenerator::GenerateBlock(byte *output, size_t size) { CRYPTOPP_UNUSED(output), CRYPTOPP_UNUSED(size); -#if 0 - // This breaks AutoSeededX917RNG generators. - throw NotImplemented("RandomNumberGenerator: GenerateBlock not implemented"); -#endif - ArraySink s(output, size); GenerateIntoBufferedTransformation(s, DEFAULT_CHANNEL, size); } @@ -946,16 +931,6 @@ int LibraryVersion(CRYPTOPP_NOINLINE_DOTDOTDOT) return CRYPTOPP_BUILD_VERSION; } -// ***************** C++ Static Initialization ******************** - -#if 0 -const std::string DEFAULT_CHANNEL; -const std::string AAD_CHANNEL("AAD"); - -NullNameValuePairs s_nullNameValuePairs; -const NameValuePairs&g_nullNameValuePairs = dynamic_cast(s_nullNameValuePairs); -#endif - NAMESPACE_END // CryptoPP #endif // CRYPTOPP_IMPORTS diff --git a/cryptlib.h b/cryptlib.h index 1d9677a7..a637901d 100644 --- a/cryptlib.h +++ b/cryptlib.h @@ -471,25 +471,31 @@ ANONYMOUS_NAMESPACE_BEGIN const NullNameValuePairs s_nullNameValuePairs; ANONYMOUS_NAMESPACE_END +#if CRYPTOPP_DOXYGEN_PROCESSING //! \brief Default channel for BufferedTransformation //! \details DEFAULT_CHANNEL is equal to an empty string //! \details Crypto++ 6.0 placed DEFAULT_CHANNEL in the header, rather than declaring it as extern and //! placing the definition in the source file. As an external definition the string DEFAULT_CHANNEL //! was subject to static initialization order fiasco problems. -static const std::string DEFAULT_CHANNEL; +const std::string DEFAULT_CHANNEL; //! \brief Channel for additional authenticated data //! \details AAD_CHANNEL is equal to "AAD" //! \details Crypto++ 6.0 placed AAD_CHANNEL in the header, rather than declaring it as extern and //! placing the definition in the source file. As an external definition the string AAD_CHANNEL //! was subject to static initialization order fiasco problems. -static const std::string AAD_CHANNEL("AAD"); +const std::string AAD_CHANNEL = "AAD"; //! \brief An empty set of name-value pairs //! \details Crypto++ 6.0 placed g_nullNameValuePairs in the header, rather than declaring it as extern //! and placing the definition in the source file. As an external definition the g_nullNameValuePairs //! was subject to static initialization order fiasco problems. -static const NameValuePairs& g_nullNameValuePairs = s_nullNameValuePairs; +const NameValuePairs g_nullNameValuePairs; +#else +static const std::string DEFAULT_CHANNEL; +static const std::string AAD_CHANNEL("AAD"); +static const NameValuePairs& g_nullNameValuePairs(s_nullNameValuePairs); +#endif // Document additional name spaces which show up elsewhere in the sources. #if CRYPTOPP_DOXYGEN_PROCESSING @@ -1430,16 +1436,6 @@ public: bool Wait(unsigned long milliseconds, CallStack const& callStack); }; -#if 0 -//! \brief Default channel for BufferedTransformation -//! \details DEFAULT_CHANNEL is equal to an empty string -extern CRYPTOPP_DLL const std::string DEFAULT_CHANNEL; - -//! \brief Channel for additional authenticated data -//! \details AAD_CHANNEL is equal to "AAD" -extern CRYPTOPP_DLL const std::string AAD_CHANNEL; -#endif - //! \brief Interface for buffered transformations //! \details BufferedTransformation is a generalization of BlockTransformation, //! StreamTransformation and HashTransformation.