| 41 | } |
| 42 | |
| 43 | static void TestDecrypt(const CCrypter& crypt, const std::vector<unsigned char>& vchCiphertext, \ |
| 44 | const std::vector<unsigned char>& vchPlaintext = std::vector<unsigned char>()) |
| 45 | { |
| 46 | CKeyingMaterial vchDecrypted; |
| 47 | crypt.Decrypt(vchCiphertext, vchDecrypted); |
| 48 | if (vchPlaintext.size()) |
| 49 | BOOST_CHECK(CKeyingMaterial(vchPlaintext.begin(), vchPlaintext.end()) == vchDecrypted); |
| 50 | } |
| 51 | |
| 52 | static void TestEncryptSingle(const CCrypter& crypt, const CKeyingMaterial& vchPlaintext, |
| 53 | const std::vector<unsigned char>& vchCiphertextCorrect = std::vector<unsigned char>()) |