diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-09-05 18:03:46 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-09-05 18:03:46 -0400 |
commit | b6f79af3433bb1ec6acd3f96c8c8bf74fbca9598 (patch) | |
tree | 54037d7dbc47d7a2aee0c08b6637200aaed4b1f3 /validat1.cpp | |
parent | f19b23d5b5ce33b650672e2ca52a45f0e1d74187 (diff) | |
download | cryptopp-git-b6f79af3433bb1ec6acd3f96c8c8bf74fbca9598.tar.gz |
Clear GCC warnings with -Wall -Wextra
Diffstat (limited to 'validat1.cpp')
-rw-r--r-- | validat1.cpp | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/validat1.cpp b/validat1.cpp index 9990c19e..e9f4ab91 100644 --- a/validat1.cpp +++ b/validat1.cpp @@ -1909,7 +1909,9 @@ public: template <class E, class D> class FixedRoundsCipherFactory : public CipherFactory
{
public:
- FixedRoundsCipherFactory(unsigned int keylen=0) : m_keylen(keylen?keylen:E::DEFAULT_KEYLENGTH) {}
+ FixedRoundsCipherFactory(unsigned int keylen=0) :
+ m_keylen(keylen ? keylen : static_cast<unsigned int>(E::DEFAULT_KEYLENGTH)) {}
+
unsigned int BlockSize() const {return E::BLOCKSIZE;}
unsigned int KeyLength() const {return m_keylen;}
@@ -1924,9 +1926,11 @@ public: template <class E, class D> class VariableRoundsCipherFactory : public CipherFactory
{
public:
- VariableRoundsCipherFactory(unsigned int keylen=0, unsigned int rounds=0)
- : m_keylen(keylen ? keylen : E::DEFAULT_KEYLENGTH), m_rounds(rounds ? rounds : E::DEFAULT_ROUNDS) {}
- unsigned int BlockSize() const {return E::BLOCKSIZE;}
+ VariableRoundsCipherFactory(unsigned int keylen=0, unsigned int rounds=0) :
+ m_keylen(keylen ? keylen : static_cast<unsigned int>(E::DEFAULT_KEYLENGTH)),
+ m_rounds(rounds ? rounds : static_cast<unsigned int>(E::DEFAULT_ROUNDS)) {}
+
+ unsigned int BlockSize() const {return static_cast<unsigned int>(E::BLOCKSIZE);}
unsigned int KeyLength() const {return m_keylen;}
BlockTransformation* NewEncryption(const byte *keyStr) const
@@ -2346,34 +2350,6 @@ bool ValidateCipherModes() pass = pass && !fail;
std::cout << (fail ? "FAILED " : "passed ") << "DMAC" << std::endl;
}
- {
- CTR_Mode<AES>::Encryption modeE(plain, 16, plain);
- CTR_Mode<AES>::Decryption modeD(plain, 16, plain);
- fail = !TestModeIV(modeE, modeD);
- pass = pass && !fail;
- std::cout << (fail ? "FAILED " : "passed ") << "AES CTR Mode" << std::endl;
- }
- {
- OFB_Mode<AES>::Encryption modeE(plain, 16, plain);
- OFB_Mode<AES>::Decryption modeD(plain, 16, plain);
- fail = !TestModeIV(modeE, modeD);
- pass = pass && !fail;
- std::cout << (fail ? "FAILED " : "passed ") << "AES OFB Mode" << std::endl;
- }
- {
- CFB_Mode<AES>::Encryption modeE(plain, 16, plain);
- CFB_Mode<AES>::Decryption modeD(plain, 16, plain);
- fail = !TestModeIV(modeE, modeD);
- pass = pass && !fail;
- std::cout << (fail ? "FAILED " : "passed ") << "AES CFB Mode" << std::endl;
- }
- {
- CBC_Mode<AES>::Encryption modeE(plain, 16, plain);
- CBC_Mode<AES>::Decryption modeD(plain, 16, plain);
- fail = !TestModeIV(modeE, modeD);
- pass = pass && !fail;
- std::cout << (fail ? "FAILED " : "passed ") << "AES CBC Mode" << std::endl;
- }
return pass;
}
|