| 49 | } |
| 50 | |
| 51 | static void TestEncryptSingle(const CCrypter& crypt, const CKeyingMaterial& vchPlaintext, |
| 52 | const std::vector<unsigned char>& vchCiphertextCorrect = std::vector<unsigned char>()) |
| 53 | { |
| 54 | std::vector<unsigned char> vchCiphertext; |
| 55 | crypt.Encrypt(vchPlaintext, vchCiphertext); |
| 56 | |
| 57 | if (!vchCiphertextCorrect.empty()) |
| 58 | BOOST_CHECK(vchCiphertext == vchCiphertextCorrect); |
| 59 | |
| 60 | const std::vector<unsigned char> vchPlaintext2(vchPlaintext.begin(), vchPlaintext.end()); |
| 61 | TestDecrypt(crypt, vchCiphertext, vchPlaintext2); |
| 62 | } |
| 63 | |
| 64 | static void TestEncrypt(const CCrypter& crypt, const std::vector<unsigned char>& vchPlaintextIn, \ |
| 65 | const std::vector<unsigned char>& vchCiphertextCorrect = std::vector<unsigned char>()) |