diff options
author | Jack Lloyd <[email protected]> | 2018-08-10 15:21:20 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-08-10 15:21:20 -0400 |
commit | c9a6216db4d865c7bfbcec56c36aa06dbc3de165 (patch) | |
tree | db7fac487570dd921d516f5ff7d45c825a44b5a5 /src/tests/test_ecies.cpp | |
parent | f868b8d31e91a0ae4fbc065621c2136ba898b538 (diff) |
Fix ECIES tests when cipher was disabled
Now the constructor throws instead of the encrypt/decrypt op
Diffstat (limited to 'src/tests/test_ecies.cpp')
-rw-r--r-- | src/tests/test_ecies.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/tests/test_ecies.cpp b/src/tests/test_ecies.cpp index 8e167f5bb..3648450af 100644 --- a/src/tests/test_ecies.cpp +++ b/src/tests/test_ecies.cpp @@ -51,22 +51,22 @@ void check_encrypt_decrypt(Test::Result& result, const Botan::ECDH_PrivateKey& p const Botan::InitializationVector& iv, const std::string& label, const std::vector<uint8_t>& plaintext, const std::vector<uint8_t>& ciphertext) { - Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng()); - ecies_enc.set_other_key(other_private_key.public_point()); - Botan::ECIES_Decryptor ecies_dec(other_private_key, ecies_params, Test::rng()); - if(!iv.bits_of().empty()) - { - ecies_enc.set_initialization_vector(iv); - ecies_dec.set_initialization_vector(iv); - } - if(!label.empty()) - { - ecies_enc.set_label(label); - ecies_dec.set_label(label); - } - try { + Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng()); + ecies_enc.set_other_key(other_private_key.public_point()); + Botan::ECIES_Decryptor ecies_dec(other_private_key, ecies_params, Test::rng()); + if(!iv.bits_of().empty()) + { + ecies_enc.set_initialization_vector(iv); + ecies_dec.set_initialization_vector(iv); + } + if(!label.empty()) + { + ecies_enc.set_label(label); + ecies_dec.set_label(label); + } + const std::vector<uint8_t> encrypted = ecies_enc.encrypt(plaintext, Test::rng()); if(!ciphertext.empty()) { |