From 35a2ef10a23a9b668428c931f408a4a8154adbc9 Mon Sep 17 00:00:00 2001 From: Ralph Tandetzky Date: Thu, 1 Dec 2016 15:37:04 +0100 Subject: [PATCH] Fix: GCC warning "type qualifiers ignored on function return type". This pedantic message appeared all over the code. Also removed one warning about an unused variable in release build. --- 3way.h | 2 +- adler32.h | 2 +- arc4.h | 4 ++-- blake2.h | 4 ++-- blowfish.h | 2 +- camellia.h | 2 +- cast.h | 4 ++-- chacha.h | 2 +- config.h | 4 ++-- crc.h | 4 ++-- des.h | 4 ++-- eccrypto.h | 4 ++-- elgamal.h | 2 +- emsa2.h | 2 +- esign.h | 2 +- gfpcrypt.h | 4 ++-- gost.h | 2 +- idea.h | 2 +- keccak.h | 2 +- luc.h | 2 +- mars.h | 2 +- md2.h | 2 +- md4.h | 2 +- md5.h | 2 +- modes.h | 12 ++++++------ panama.h | 4 ++-- pkcspad.h | 4 ++-- pubkey.h | 4 ++-- rc2.h | 2 +- rc5.h | 2 +- rc6.h | 2 +- ripemd.h | 8 ++++---- rsa.h | 4 ++-- safer.h | 4 ++-- salsa.h | 4 ++-- seal.h | 2 +- seed.h | 2 +- serpent.h | 2 +- sha.h | 10 +++++----- sha3.h | 2 +- shacal2.h | 2 +- shark.h | 2 +- socketft.cpp | 2 +- sosemanuk.h | 2 +- square.h | 2 +- tea.h | 6 +++--- tiger.h | 2 +- twofish.h | 2 +- wait.cpp | 1 + wake.h | 2 +- whrlpool.h | 2 +- 51 files changed, 79 insertions(+), 78 deletions(-) diff --git a/3way.h b/3way.h index a0a41577..485ad19d 100644 --- a/3way.h +++ b/3way.h @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief ThreeWay block cipher information struct ThreeWay_Info : public FixedBlockSize<12>, public FixedKeyLength<12>, public VariableRounds<11> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "3-Way";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "3-Way";} }; //! \class ThreeWay diff --git a/adler32.h b/adler32.h index e86650d0..37dc11a9 100644 --- a/adler32.h +++ b/adler32.h @@ -20,7 +20,7 @@ public: void Update(const byte *input, size_t length); void TruncatedFinal(byte *hash, size_t size); unsigned int DigestSize() const {return DIGESTSIZE;} - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Adler32";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Adler32";} std::string AlgorithmName() const {return StaticAlgorithmName();} private: diff --git a/arc4.h b/arc4.h index c2043572..f8a8b51c 100644 --- a/arc4.h +++ b/arc4.h @@ -24,7 +24,7 @@ class CRYPTOPP_NO_VTABLE ARC4_Base : public VariableKeyLength<16, 1, 256>, publi public: ~ARC4_Base(); - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "ARC4";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "ARC4";} void GenerateBlock(byte *output, size_t size); void DiscardBytes(size_t n); @@ -59,7 +59,7 @@ DOCUMENTED_TYPEDEF(SymmetricCipherFinal, ARC4) class CRYPTOPP_NO_VTABLE MARC4_Base : public ARC4_Base { public: - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "MARC4";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MARC4";} typedef SymmetricCipherFinal Encryption; typedef SymmetricCipherFinal Decryption; diff --git a/blake2.h b/blake2.h index e18569b2..24f5bdd5 100644 --- a/blake2.h +++ b/blake2.h @@ -41,7 +41,7 @@ struct BLAKE2_Info : public VariableKeyLength<(T_64bit ? 64 : 32),0,(T_64bit ? 6 CRYPTOPP_CONSTANT(SALTSIZE = (T_64bit ? 16 : 8)) CRYPTOPP_CONSTANT(PERSONALIZATIONSIZE = (T_64bit ? 16 : 8)) - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return (T_64bit ? "BLAKE2b" : "BLAKE2s");} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return (T_64bit ? "BLAKE2b" : "BLAKE2s");} }; //! \class BLAKE2_ParameterBlock @@ -180,7 +180,7 @@ public: //! \brief Retrieve the static algorithm name //! \returns the algorithm name (BLAKE2s or BLAKE2b) - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return BLAKE2_Info::StaticAlgorithmName();} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return BLAKE2_Info::StaticAlgorithmName();} //! \brief Retrieve the object's name //! \returns the object's algorithm name following RFC 7693 diff --git a/blowfish.h b/blowfish.h index f61ceafd..d14b0231 100644 --- a/blowfish.h +++ b/blowfish.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Blowfish block cipher information struct Blowfish_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 4, 56>, public FixedRounds<16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Blowfish";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Blowfish";} }; // Blowfish diff --git a/camellia.h b/camellia.h index 94c7edc1..dae09718 100644 --- a/camellia.h +++ b/camellia.h @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Camellia block cipher information struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Camellia";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Camellia";} }; //! \class Camellia diff --git a/cast.h b/cast.h index 5b21e69e..f2dc9242 100644 --- a/cast.h +++ b/cast.h @@ -23,7 +23,7 @@ protected: //! \brief CAST128 block cipher information struct CAST128_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 5, 16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "CAST-128";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CAST-128";} }; //! \class CAST128 @@ -68,7 +68,7 @@ public: //! \brief CAST256 block cipher information struct CAST256_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 4> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "CAST-256";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CAST-256";} }; //! \class CAST256 diff --git a/chacha.h b/chacha.h index 4c93dbcc..9beabad2 100644 --- a/chacha.h +++ b/chacha.h @@ -25,7 +25,7 @@ NAMESPACE_BEGIN(CryptoPP) template struct ChaCha_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8>, public FixedRounds { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() { + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() { return (R==8?"ChaCha8":(R==12?"ChaCha12":(R==20?"ChaCha20":"ChaCha"))); } }; diff --git a/config.h b/config.h index c0383fb6..7e6121b3 100644 --- a/config.h +++ b/config.h @@ -922,10 +922,10 @@ NAMESPACE_END // http://stackoverflow.com/a/13867690/608639 #if defined(CRYPTOPP_CXX11_CONSTEXPR) -# define CRYPTOPP_STATIC_CONSTEXPR static constexpr const +# define CRYPTOPP_STATIC_CONSTEXPR static constexpr # define CRYPTOPP_CONSTEXPR constexpr #else -# define CRYPTOPP_STATIC_CONSTEXPR static const +# define CRYPTOPP_STATIC_CONSTEXPR static # define CRYPTOPP_CONSTEXPR #endif // CRYPTOPP_CXX11_CONSTEXPR diff --git a/crc.h b/crc.h index 5becb547..fdabe97e 100644 --- a/crc.h +++ b/crc.h @@ -31,7 +31,7 @@ public: void Update(const byte *input, size_t length); void TruncatedFinal(byte *hash, size_t size); unsigned int DigestSize() const {return DIGESTSIZE;} - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "CRC32";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32";} std::string AlgorithmName() const {return StaticAlgorithmName();} void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);} @@ -56,7 +56,7 @@ public: void Update(const byte *input, size_t length); void TruncatedFinal(byte *hash, size_t size); unsigned int DigestSize() const {return DIGESTSIZE;} - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "CRC32C";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "CRC32C";} std::string AlgorithmName() const {return StaticAlgorithmName();} void UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);} diff --git a/des.h b/des.h index 80962738..0389cfbd 100644 --- a/des.h +++ b/des.h @@ -30,7 +30,7 @@ protected: struct DES_Info : public FixedBlockSize<8>, public FixedKeyLength<8> { // disable DES in DLL version by not exporting this function - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "DES";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "DES";} }; //! \class DES @@ -125,7 +125,7 @@ public: //! \brief DESX block cipher information struct DES_XEX3_Info : public FixedBlockSize<8>, public FixedKeyLength<24> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "DES-XEX3";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "DES-XEX3";} }; //! \class DES_XEX3 diff --git a/eccrypto.h b/eccrypto.h index b3157d1e..9be28dde 100644 --- a/eccrypto.h +++ b/eccrypto.h @@ -309,7 +309,7 @@ template class DL_Algorithm_ECDSA : public DL_Algorithm_GDSA { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECDSA";} #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Algorithm_ECDSA() {} @@ -323,7 +323,7 @@ template class DL_Algorithm_ECNR : public DL_Algorithm_NR { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECNR";} #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Algorithm_ECNR() {} diff --git a/elgamal.h b/elgamal.h index 770ac2c5..6572269b 100644 --- a/elgamal.h +++ b/elgamal.h @@ -138,7 +138,7 @@ struct ElGamal { typedef DL_CryptoSchemeOptions SchemeOptions; - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "ElgamalEnc/Crypto++Padding";} typedef SchemeOptions::GroupParameters GroupParameters; //! implements PK_Encryptor interface diff --git a/emsa2.h b/emsa2.h index 7e53002d..82ae417e 100644 --- a/emsa2.h +++ b/emsa2.h @@ -61,7 +61,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId; class CRYPTOPP_DLL EMSA2Pad : public EMSA2HashIdLookup { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "EMSA2";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "EMSA2";} size_t MinRepresentativeBitLength(size_t hashIdentifierLength, size_t digestLength) const {CRYPTOPP_UNUSED(hashIdentifierLength); return 8*digestLength + 31;} diff --git a/esign.h b/esign.h index 9cc0479c..6afb544f 100644 --- a/esign.h +++ b/esign.h @@ -98,7 +98,7 @@ template class EMSA5Pad : public PK_DeterministicSignatureMessageEncodingMethod { public: - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "EMSA5";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "EMSA5";} void ComputeMessageRepresentative(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength, diff --git a/gfpcrypt.h b/gfpcrypt.h index 2c5ba237..bd87146b 100644 --- a/gfpcrypt.h +++ b/gfpcrypt.h @@ -196,7 +196,7 @@ template class DL_Algorithm_GDSA : public DL_ElgamalLikeSignatureAlgorithm { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "DSA-1363";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "DSA-1363";} #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Algorithm_GDSA() {} @@ -234,7 +234,7 @@ template class DL_Algorithm_NR : public DL_ElgamalLikeSignatureAlgorithm { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "NR";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "NR";} #ifndef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY_562 virtual ~DL_Algorithm_NR() {} diff --git a/gost.h b/gost.h index e4f1070c..55f9ec5e 100644 --- a/gost.h +++ b/gost.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief GOST block cipher information struct GOST_Info : public FixedBlockSize<8>, public FixedKeyLength<32> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "GOST";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "GOST";} }; //! \class GOST diff --git a/idea.h b/idea.h index 0ad5663e..75dd98ea 100644 --- a/idea.h +++ b/idea.h @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \since Crypto++ 1.0 struct IDEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public FixedRounds<8> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "IDEA";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "IDEA";} }; //! \class IDEA diff --git a/keccak.h b/keccak.h index f29ae4f2..24ded0ca 100644 --- a/keccak.h +++ b/keccak.h @@ -50,7 +50,7 @@ public: Keccak(unsigned int digestSize) : m_digestSize(digestSize) {Restart();} unsigned int DigestSize() const {return m_digestSize;} std::string AlgorithmName() const {return "Keccak-" + IntToString(m_digestSize*8);} - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() { return "Keccak"; } + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() { return "Keccak"; } unsigned int OptimalDataAlignment() const {return GetAlignmentOf();} void Update(const byte *input, size_t length); diff --git a/luc.h b/luc.h index d2d7cb3a..ead0a4fc 100644 --- a/luc.h +++ b/luc.h @@ -232,7 +232,7 @@ protected: class DL_Algorithm_LUC_HMP : public DL_ElgamalLikeSignatureAlgorithm { public: - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "LUC-HMP";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "LUC-HMP";} void Sign(const DL_GroupParameters ¶ms, const Integer &x, const Integer &k, const Integer &e, Integer &r, Integer &s) const; bool Verify(const DL_GroupParameters ¶ms, const DL_PublicKey &publicKey, const Integer &e, const Integer &r, const Integer &s) const; diff --git a/mars.h b/mars.h index 2ebe1548..a1060bc3 100644 --- a/mars.h +++ b/mars.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief MARS block cipher information struct MARS_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 8> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "MARS";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MARS";} }; //! \class MARS diff --git a/md2.h b/md2.h index 5e3e2ff8..b98e5453 100644 --- a/md2.h +++ b/md2.h @@ -17,7 +17,7 @@ public: void TruncatedFinal(byte *hash, size_t size); unsigned int DigestSize() const {return DIGESTSIZE;} unsigned int BlockSize() const {return BLOCKSIZE;} - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "MD2";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "MD2";} CRYPTOPP_CONSTANT(DIGESTSIZE = 16) CRYPTOPP_CONSTANT(BLOCKSIZE = 16) diff --git a/md4.h b/md4.h index 2908bd13..3eb327d5 100644 --- a/md4.h +++ b/md4.h @@ -15,7 +15,7 @@ class MD4 : public IteratedHashWithStaticTransformOptimalNumberOfParallelBlocks();} void ProcessData(byte *outString, const byte *inString, size_t length); - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "ECB";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "ECB";} }; //! \class CBC_ModeBase @@ -227,7 +227,7 @@ public: IV_Requirement IVRequirement() const {return UNPREDICTABLE_RANDOM_IV;} bool RequireAlignedInput() const {return false;} unsigned int MinLastBlockSize() const {return 0;} - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "CBC";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "CBC";} }; //! \class CBC_Encryption @@ -246,7 +246,7 @@ public: void SetStolenIV(byte *iv) {m_stolenIV = iv;} unsigned int MinLastBlockSize() const {return BlockSize()+1;} void ProcessLastBlock(byte *outString, const byte *inString, size_t length); - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "CBC/CTS";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "CBC/CTS";} protected: void UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs ¶ms) diff --git a/panama.h b/panama.h index 5381f1e3..1ec040e8 100644 --- a/panama.h +++ b/panama.h @@ -44,7 +44,7 @@ public: PanamaHash() {Panama::Reset();} unsigned int DigestSize() const {return DIGESTSIZE;} void TruncatedFinal(byte *hash, size_t size); - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} protected: void Init() {Panama::Reset();} @@ -128,7 +128,7 @@ public: template struct PanamaCipherInfo : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 32> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == BIG_ENDIAN_ORDER ? "Panama-BE" : "Panama-LE";} }; //! \class PanamaCipherPolicy diff --git a/pkcspad.h b/pkcspad.h index 411cbb4e..8b8005e2 100644 --- a/pkcspad.h +++ b/pkcspad.h @@ -22,7 +22,7 @@ NAMESPACE_BEGIN(CryptoPP) class PKCS_EncryptionPaddingScheme : public PK_EncryptionMessageEncodingMethod { public: - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "EME-PKCS1-v1_5";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "EME-PKCS1-v1_5";} size_t MaxUnpaddedLength(size_t paddedLength) const; void Pad(RandomNumberGenerator &rng, const byte *raw, size_t inputLength, byte *padded, size_t paddedLength, const NameValuePairs ¶meters) const; @@ -67,7 +67,7 @@ CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration; class CRYPTOPP_DLL PKCS1v15_SignatureMessageEncodingMethod : public PK_DeterministicSignatureMessageEncodingMethod { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "EMSA-PKCS1-v1_5";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "EMSA-PKCS1-v1_5";} size_t MinRepresentativeBitLength(size_t hashIdentifierSize, size_t digestSize) const {return 8 * (digestSize + hashIdentifierSize + 10);} diff --git a/pubkey.h b/pubkey.h index 57f0f8a4..1f7800f7 100644 --- a/pubkey.h +++ b/pubkey.h @@ -719,7 +719,7 @@ CRYPTOPP_DLL void CRYPTOPP_API P1363_MGF1KDF2_Common(HashTransformation &hash, b class P1363_MGF1 : public MaskGeneratingFunction { public: - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "MGF1";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "MGF1";} void GenerateAndMask(HashTransformation &hash, byte *output, size_t outputLength, const byte *input, size_t inputLength, bool mask = true) const { P1363_MGF1KDF2_Common(hash, output, outputLength, input, inputLength, NULL, 0, mask, 0); @@ -1986,7 +1986,7 @@ public: virtual ~DL_KeyAgreementAlgorithm_DH() {} #endif - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return COFACTOR_OPTION::ToEnum() == INCOMPATIBLE_COFACTOR_MULTIPLICTION ? "DHC" : "DH";} Element AgreeWithEphemeralPrivateKey(const DL_GroupParameters ¶ms, const DL_FixedBasePrecomputation &publicPrecomputation, const Integer &privateExponent) const diff --git a/rc2.h b/rc2.h index c219c0b0..6f989be6 100644 --- a/rc2.h +++ b/rc2.h @@ -18,7 +18,7 @@ struct RC2_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 1, 128> { CRYPTOPP_CONSTANT(DEFAULT_EFFECTIVE_KEYLENGTH = 1024) CRYPTOPP_CONSTANT(MAX_EFFECTIVE_KEYLENGTH = 1024) - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "RC2";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC2";} }; //! \class RC2 diff --git a/rc5.h b/rc5.h index 28594ee1..eeedfa98 100644 --- a/rc5.h +++ b/rc5.h @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \since Crypto++ 1.0 struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "RC5";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC5";} typedef word32 RC5_WORD; }; diff --git a/rc6.h b/rc6.h index e4610782..8894a42f 100644 --- a/rc6.h +++ b/rc6.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief RC6 block cipher information struct RC6_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, public VariableRounds<20> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "RC6";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC6";} typedef word32 RC6_WORD; }; diff --git a/ripemd.h b/ripemd.h index 7530976d..23ed9de6 100644 --- a/ripemd.h +++ b/ripemd.h @@ -19,7 +19,7 @@ class RIPEMD160 : public IteratedHashWithStaticTransform //! \since Crypto++ 1.0 struct CRYPTOPP_DLL RSA_ISO { - CRYPTOPP_STATIC_CONSTEXPR char* const CRYPTOPP_API StaticAlgorithmName() {return "RSA-ISO";} + CRYPTOPP_STATIC_CONSTEXPR const char* CRYPTOPP_API StaticAlgorithmName() {return "RSA-ISO";} typedef RSAFunction_ISO PublicKey; typedef InvertibleRSAFunction_ISO PrivateKey; }; diff --git a/safer.h b/safer.h index ecb70c57..d9ba4f65 100644 --- a/safer.h +++ b/safer.h @@ -66,7 +66,7 @@ protected: //! \brief SAFER-K block cipher information struct SAFER_K_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "SAFER-K";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SAFER-K";} }; //! \class SAFER_K @@ -83,7 +83,7 @@ public: //! \brief SAFER-SK block cipher information struct SAFER_SK_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 8, 16, 8>, public VariableRounds<10, 1, 13> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "SAFER-SK";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SAFER-SK";} }; //! \class SAFER_SK diff --git a/salsa.h b/salsa.h index 9a55fda2..bb7a5ca7 100644 --- a/salsa.h +++ b/salsa.h @@ -22,7 +22,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Salsa20 stream cipher information struct Salsa20_Info : public VariableKeyLength<32, 16, 32, 16, SimpleKeyingInterface::UNIQUE_IV, 8> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Salsa20";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Salsa20";} }; //! \class Salsa20_Policy @@ -58,7 +58,7 @@ struct Salsa20 : public Salsa20_Info, public SymmetricCipherDocumentation //! \brief XSalsa20 stream cipher information struct XSalsa20_Info : public FixedKeyLength<32, SimpleKeyingInterface::UNIQUE_IV, 24> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "XSalsa20";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "XSalsa20";} }; //! \class XSalsa20_Policy diff --git a/seal.h b/seal.h index 4d87c45e..a098de04 100644 --- a/seal.h +++ b/seal.h @@ -17,7 +17,7 @@ NAMESPACE_BEGIN(CryptoPP) template struct SEAL_Info : public FixedKeyLength<20, SimpleKeyingInterface::INTERNALLY_GENERATED_IV, 4> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "SEAL-3.0-LE" : "SEAL-3.0-BE";} }; //! \class SEAL_Policy diff --git a/seed.h b/seed.h index 9daa3fee..00a9cc1b 100644 --- a/seed.h +++ b/seed.h @@ -17,7 +17,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \since Crypto++ 5.6.0 struct SEED_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, public FixedRounds<16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "SEED";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SEED";} }; //! \class SEED diff --git a/serpent.h b/serpent.h index 9fb398f0..e769d20c 100644 --- a/serpent.h +++ b/serpent.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Serpent block cipher information struct Serpent_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, public FixedRounds<32> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Serpent";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Serpent";} }; //! \class Serpent diff --git a/sha.h b/sha.h index 008c9b37..b99621d9 100644 --- a/sha.h +++ b/sha.h @@ -27,7 +27,7 @@ class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform();} void Update(const byte *input, size_t length); diff --git a/shacal2.h b/shacal2.h index 34c07cbb..6be71e1e 100644 --- a/shacal2.h +++ b/shacal2.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief SHACAL2 block cipher information struct SHACAL2_Info : public FixedBlockSize<32>, public VariableKeyLength<16, 16, 64> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "SHACAL-2";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHACAL-2";} }; //! \class SHACAL2 diff --git a/shark.h b/shark.h index 2caf21ce..8e2d2a0e 100644 --- a/shark.h +++ b/shark.h @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief SHARK block cipher information struct SHARK_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<6, 2> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "SHARK-E";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "SHARK-E";} }; //! \class SHARK diff --git a/socketft.cpp b/socketft.cpp index b44c0592..7aebcede 100644 --- a/socketft.cpp +++ b/socketft.cpp @@ -512,7 +512,7 @@ unsigned int SocketReceiver::GetReceiveResult() // ************************************************************* SocketSender::SocketSender(Socket &s) - : m_s(s), m_resultPending(false), m_lastResult(0) + : m_s(s), m_lastResult(0), m_resultPending(false) { m_event.AttachHandle(CreateEvent(NULL, true, false, NULL), true); m_s.CheckAndHandleError("CreateEvent", m_event.HandleValid()); diff --git a/sosemanuk.h b/sosemanuk.h index 85796628..1a0da4cc 100644 --- a/sosemanuk.h +++ b/sosemanuk.h @@ -23,7 +23,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \since Crypto++ 5.5 struct SosemanukInfo : public VariableKeyLength<16, 1, 32, 1, SimpleKeyingInterface::UNIQUE_IV, 16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Sosemanuk";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Sosemanuk";} }; //! \class SosemanukPolicy diff --git a/square.h b/square.h index 5bb22f78..01e6ec70 100644 --- a/square.h +++ b/square.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Square block cipher information struct Square_Info : public FixedBlockSize<16>, public FixedKeyLength<16>, FixedRounds<8> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Square";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Square";} }; //! \class Square diff --git a/tea.h b/tea.h index 029af0fd..888f5882 100644 --- a/tea.h +++ b/tea.h @@ -16,7 +16,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief TEA block cipher information struct TEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "TEA";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "TEA";} }; //! \class TEA @@ -64,7 +64,7 @@ typedef TEA::Decryption TEADecryption; //! \brief XTEA block cipher information struct XTEA_Info : public FixedBlockSize<8>, public FixedKeyLength<16>, public VariableRounds<32> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "XTEA";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "XTEA";} }; //! \class XTEA @@ -109,7 +109,7 @@ public: //! \brief BTEA block cipher information struct BTEA_Info : public FixedKeyLength<16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "BTEA";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "BTEA";} }; //! \class BTEA diff --git a/tiger.h b/tiger.h index 3e220bf3..aaca69a0 100644 --- a/tiger.h +++ b/tiger.h @@ -19,7 +19,7 @@ public: static void InitState(HashWordType *state); static void Transform(word64 *digest, const word64 *data); void TruncatedFinal(byte *hash, size_t size); - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Tiger";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Tiger";} protected: static const word64 table[4*256+3]; diff --git a/twofish.h b/twofish.h index 29041787..93f592c2 100644 --- a/twofish.h +++ b/twofish.h @@ -15,7 +15,7 @@ NAMESPACE_BEGIN(CryptoPP) //! \brief Twofish block cipher information struct Twofish_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>, FixedRounds<16> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Twofish";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Twofish";} }; //! \class Twofish diff --git a/wait.cpp b/wait.cpp index b624fea7..e904097f 100644 --- a/wait.cpp +++ b/wait.cpp @@ -164,6 +164,7 @@ WaitObjectContainer::~WaitObjectContainer() CRYPTOPP_ASSERT(dwResult < (DWORD)m_threads.size()); #else DWORD dwResult = ::WaitForMultipleObjects((DWORD)m_threads.size(), threadHandles, TRUE, INFINITE); + CRYPTOPP_UNUSED(dwResult); CRYPTOPP_ASSERT(dwResult < (DWORD)m_threads.size()); #endif diff --git a/wake.h b/wake.h index a5288290..79d8b601 100644 --- a/wake.h +++ b/wake.h @@ -19,7 +19,7 @@ NAMESPACE_BEGIN(CryptoPP) template struct WAKE_OFB_Info : public FixedKeyLength<32> { - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return B::ToEnum() == LITTLE_ENDIAN_ORDER ? "WAKE-OFB-LE" : "WAKE-OFB-BE";} }; class CRYPTOPP_NO_VTABLE WAKE_Base diff --git a/whrlpool.h b/whrlpool.h index d4d9c9e4..dd6a0742 100644 --- a/whrlpool.h +++ b/whrlpool.h @@ -13,7 +13,7 @@ public: static void InitState(HashWordType *state); static void Transform(word64 *digest, const word64 *data); void TruncatedFinal(byte *hash, size_t size); - CRYPTOPP_STATIC_CONSTEXPR char* const StaticAlgorithmName() {return "Whirlpool";} + CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "Whirlpool";} }; NAMESPACE_END