aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_ecies.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-10 12:44:55 -0400
committerJack Lloyd <[email protected]>2018-08-10 12:44:55 -0400
commit87e4cd8c71511837b38406802f6e92e32b1890e9 (patch)
tree000aed5da6cfabd3009937a88cafb959f3988ea1 /src/tests/test_ecies.cpp
parent256cfa3be098fb45d5c2de047f88786e88051e73 (diff)
Add functions to get size of PK ciphertext,plaintext
Needed for https://github.com/strongswan/strongswan/pull/109
Diffstat (limited to 'src/tests/test_ecies.cpp')
-rw-r--r--src/tests/test_ecies.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tests/test_ecies.cpp b/src/tests/test_ecies.cpp
index 63619a8a4..8e167f5bb 100644
--- a/src/tests/test_ecies.cpp
+++ b/src/tests/test_ecies.cpp
@@ -279,10 +279,9 @@ Test::Result test_kdf_not_found()
"HMAC(SHA-512)", 20, Botan::PointGFp::Compression_Type::COMPRESSED,
flags);
- Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng());
-
- result.test_throws("kdf not found", [ &ecies_enc ]()
+ result.test_throws("kdf not found", [&]()
{
+ Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng());
ecies_enc.encrypt(std::vector<uint8_t>(8), Test::rng());
});
@@ -304,10 +303,9 @@ Test::Result test_mac_not_found()
"XYZMAC(SHA-512)", 20, Botan::PointGFp::Compression_Type::COMPRESSED,
flags);
- Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng());
-
- result.test_throws("mac not found", [ &ecies_enc ]()
+ result.test_throws("mac not found", [&]()
{
+ Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng());
ecies_enc.encrypt(std::vector<uint8_t>(8), Test::rng());
});
@@ -329,10 +327,9 @@ Test::Result test_cipher_not_found()
"HMAC(SHA-512)", 20, Botan::PointGFp::Compression_Type::COMPRESSED,
flags);
- Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng());
-
- result.test_throws("cipher not found", [ &ecies_enc ]()
+ result.test_throws("cipher not found", [&]()
{
+ Botan::ECIES_Encryptor ecies_enc(private_key, ecies_params, Test::rng());
ecies_enc.encrypt(std::vector<uint8_t>(8), Test::rng());
});