From 7ece03d7622d2b97831311e2a57b8940542123de Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 11 Dec 2016 06:44:18 -0500 Subject: [PATCH] Updated documentation (Issue 345) --- default.cpp | 5 +++-- default.h | 59 +++++++++++++++++++++++++++++++++++++++++++++++++---- test.cpp | 2 +- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/default.cpp b/default.cpp index dc781bbf..99ba4ba4 100644 --- a/default.cpp +++ b/default.cpp @@ -287,8 +287,9 @@ void DataDecryptorWithMAC::LastPut(const byte *inString, size_t l throw MACBadErr(); } -template class DataParametersInfo; -template class DataParametersInfo; +template struct DataParametersInfo; +template struct DataParametersInfo; + template class DataEncryptor; template class DataDecryptor; template class DataEncryptor; diff --git a/default.h b/default.h index 5f33a3c8..b23174d9 100644 --- a/default.h +++ b/default.h @@ -71,7 +71,7 @@ typedef DataParametersInfo DefaultParametersInfo; //! \class DataEncryptor -//! \brief Password-Based Encryptor +//! \brief Password-based Encryptor //! \tparam BC BlockCipher based class used for encryption //! \tparam H HashTransformation based class used for mashing //! \tparam Info Constants used by the algorithms @@ -110,7 +110,7 @@ private: }; //! \class DataDecryptor -//! \brief Password-Based Decryptor +//! \brief Password-based Decryptor //! \tparam BC BlockCipher based class used for encryption //! \tparam H HashTransformation based class used for mashing //! \tparam Info Constants used by the algorithms @@ -161,7 +161,7 @@ private: }; //! \class DataEncryptorWithMAC -//! \brief Password-Based encryptor +//! \brief Password-based encryptor with MAC //! \tparam BC BlockCipher based class used for encryption //! \tparam H HashTransformation based class used for mashing //! \tparam MAC HashTransformation based class used for authentication @@ -201,7 +201,7 @@ private: }; //! \class DataDecryptorWithMAC -//! \brief Password-Based decryptor +//! \brief Password-based decryptor with MAC //! \tparam BC BlockCipher based class used for encryption //! \tparam H HashTransformation based class used for mashing //! \tparam MAC HashTransformation based class used for authentication @@ -246,6 +246,56 @@ private: bool m_throwException; }; +#if defined(CRYPTOPP_DOXYGEN_PROCESSING) +//! \class LegacyEncryptor +//! \brief Password-based encryptor (deprecated) +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct LegacyEncryptor : public DataEncryptor {}; +//! \class LegacyDecryptor +//! \brief Password-based decryptor (deprecated) +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct LegacyDecryptor : public DataDecryptor {}; +//! \class DefaultEncryptor +//! \brief Password-based encryptor +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct DefaultEncryptor : public DataEncryptor {}; +//! \class DefaultDecryptor +//! \brief Password-based decryptor +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct DefaultDecryptor : public DataDecryptor {}; +//! \class LegacyEncryptorWithMAC +//! \brief Password-based encryptor with MAC (deprecated) +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct LegacyEncryptorWithMAC : public DataEncryptorWithMAC {}; +//! \class LegacyDecryptorWithMAC +//! \brief Password-based decryptor with MAC (deprecated) +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct LegacyDecryptorWithMAC : public DataDecryptorWithMAC {}; +//! \class DefaultEncryptorWithMAC +//! \brief Password-based encryptor with MAC +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct DefaultEncryptorWithMAC : public DataEncryptorWithMAC {}; +//! \class DefaultDecryptorWithMAC +//! \brief Password-based decryptor with MAC +//! \details Crypto++ 5.6.5 and earlier used the legacy algorithms, including DES_EDE2 and SHA1. +//! Crypto++ 5.7 switched to AES and SHA256. The updated algorithms are available with the +//! Default* classes, and the old algorithms are available with the Legacy* classes. +struct DefaultDecryptorWithMAC : public DataDecryptorWithMAC {}; +#else typedef DataEncryptor LegacyEncryptor; typedef DataDecryptor LegacyDecryptor; @@ -257,6 +307,7 @@ typedef DataDecryptorWithMAC DefaultEncryptorWithMAC; typedef DataDecryptorWithMAC DefaultDecryptorWithMAC; +#endif NAMESPACE_END diff --git a/test.cpp b/test.cpp index dc442713..dd28f35b 100644 --- a/test.cpp +++ b/test.cpp @@ -439,7 +439,7 @@ T StringToValue(const std::string& str) { // Arbitrary, but we need to clear a Coverity finding TAINTED_SCALAR if(iss.str().length() > 25) - throw InvalidArgument("cryptest.exe: '" + str +"' is tool ong"); + throw InvalidArgument("cryptest.exe: '" + str +"' is too long"); T value; iss >> std::noskipws >> value;