aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_ecies.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-10 15:21:20 -0400
committerJack Lloyd <[email protected]>2018-08-10 15:21:20 -0400
commitc9a6216db4d865c7bfbcec56c36aa06dbc3de165 (patch)
treedb7fac487570dd921d516f5ff7d45c825a44b5a5 /src/tests/test_ecies.cpp
parentf868b8d31e91a0ae4fbc065621c2136ba898b538 (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.cpp28
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())
{