Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/test/crypto_tests.cpp
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | static void TestDecrypt( | ||||
for (CKeyingMaterial::iterator it = | for (CKeyingMaterial::iterator it = | ||||
vchDecrypted1.end() - AES_BLOCK_SIZE; | vchDecrypted1.end() - AES_BLOCK_SIZE; | ||||
it != vchDecrypted1.end() - 1; it++) | it != vchDecrypted1.end() - 1; it++) | ||||
*it = 0; | *it = 0; | ||||
} | } | ||||
BOOST_CHECK_MESSAGE( | BOOST_CHECK_MESSAGE( | ||||
vchDecrypted1 == vchDecrypted2, | vchDecrypted1 == vchDecrypted2, | ||||
HexStr(vchDecrypted1.begin(), vchDecrypted1.end()) + " != " + | HexStr(vchDecrypted1.begin(), vchDecrypted1.end()) + | ||||
HexStr(vchDecrypted2.begin(), vchDecrypted2.end())); | " != " + HexStr(vchDecrypted2.begin(), vchDecrypted2.end())); | ||||
if (vchPlaintext.size()) | if (vchPlaintext.size()) | ||||
BOOST_CHECK(CKeyingMaterial(vchPlaintext.begin(), | BOOST_CHECK(CKeyingMaterial(vchPlaintext.begin(), | ||||
vchPlaintext.end()) == vchDecrypted2); | vchPlaintext.end()) == vchDecrypted2); | ||||
} | } | ||||
static void | static void | ||||
TestEncryptSingle(const CCrypter &crypt, | TestEncryptSingle(const CCrypter &crypt, | ||||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |