aboutsummaryrefslogtreecommitdiff
path: root/src/test/crypto_tests.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2016-09-27 13:25:42 +0200
committerWladimir J. van der Laan <[email protected]>2016-09-27 13:25:54 +0200
commit920ca1f0bf0b786250e3119a05984e0c2af1350a (patch)
tree72ffd41a7d512d1a71dd6e8701c3bcb7f9849d5a /src/test/crypto_tests.cpp
parentMerge #8803: Ping regularly in p2p-segwit.py to keep connection alive (diff)
parentDo not shadow variables (diff)
downloaddiscoin-920ca1f0bf0b786250e3119a05984e0c2af1350a.tar.xz
discoin-920ca1f0bf0b786250e3119a05984e0c2af1350a.zip
Merge #8655: Do not shadow variables (trivials)
4731cab Do not shadow variables (Pavel Janík)
Diffstat (limited to 'src/test/crypto_tests.cpp')
-rw-r--r--src/test/crypto_tests.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp
index 58a62ee02..ff0adae1d 100644
--- a/src/test/crypto_tests.cpp
+++ b/src/test/crypto_tests.cpp
@@ -133,13 +133,13 @@ void TestAES128CBC(const std::string &hexkey, const std::string &hexiv, bool pad
{
std::vector<unsigned char> sub(i, in.end());
std::vector<unsigned char> subout(sub.size() + AES_BLOCKSIZE);
- int size = enc.Encrypt(&sub[0], sub.size(), &subout[0]);
- if (size != 0)
+ int _size = enc.Encrypt(&sub[0], sub.size(), &subout[0]);
+ if (_size != 0)
{
- subout.resize(size);
+ subout.resize(_size);
std::vector<unsigned char> subdecrypted(subout.size());
- size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]);
- subdecrypted.resize(size);
+ _size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]);
+ subdecrypted.resize(_size);
BOOST_CHECK(decrypted.size() == in.size());
BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + std::string(" != ") + HexStr(sub));
}
@@ -174,13 +174,13 @@ void TestAES256CBC(const std::string &hexkey, const std::string &hexiv, bool pad
{
std::vector<unsigned char> sub(i, in.end());
std::vector<unsigned char> subout(sub.size() + AES_BLOCKSIZE);
- int size = enc.Encrypt(&sub[0], sub.size(), &subout[0]);
- if (size != 0)
+ int _size = enc.Encrypt(&sub[0], sub.size(), &subout[0]);
+ if (_size != 0)
{
- subout.resize(size);
+ subout.resize(_size);
std::vector<unsigned char> subdecrypted(subout.size());
- size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]);
- subdecrypted.resize(size);
+ _size = dec.Decrypt(&subout[0], subout.size(), &subdecrypted[0]);
+ subdecrypted.resize(_size);
BOOST_CHECK(decrypted.size() == in.size());
BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + std::string(" != ") + HexStr(sub));
}