aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-25 16:42:53 -0500
committerJack Lloyd <[email protected]>2016-11-25 16:42:53 -0500
commitcdee866369b274151b745cb9b31b65c8207f638d (patch)
treebb2e7ad837c98e0ad95e8a30f69633879f7685d9 /src/tests
parent36f260c4b97ba4b2253a3215e6c9afe35022ac04 (diff)
Make XMSS more friendly about invalid params.
Previously just throw an exception from map.at Add an XMSS keygen test, and add default params for create_private_key
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_xmss.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/tests/test_xmss.cpp b/src/tests/test_xmss.cpp
index 534a8601e..eb75daa38 100644
--- a/src/tests/test_xmss.cpp
+++ b/src/tests/test_xmss.cpp
@@ -60,16 +60,27 @@ class XMSS_Signature_Verify_Tests : public PK_Signature_Verification_Test
std::unique_ptr<Botan::Public_Key> load_public_key(const VarMap& vars) override
{
- const std::vector<byte> raw_key = get_req_bin(vars, "PublicKey");
- const Botan::secure_vector<byte> sec_key(raw_key.begin(), raw_key.end());
+ const std::vector<byte> raw_key = get_req_bin(vars, "PublicKey");
+ const Botan::secure_vector<byte> sec_key(raw_key.begin(), raw_key.end());
- std::unique_ptr<Botan::Public_Key> key(new Botan::XMSS_PublicKey(sec_key));
+ std::unique_ptr<Botan::Public_Key> key(new Botan::XMSS_PublicKey(sec_key));
return key;
}
};
+class XMSS_Keygen_Tests : public PK_Key_Generation_Test
+ {
+ public:
+ std::vector<std::string> keygen_params() const override
+ {
+ return { "XMSS_SHA2-256_W16_H10" };
+ }
+ std::string algo_name() const override { return "XMSS"; }
+ };
+
BOTAN_REGISTER_TEST("xmss_sign", XMSS_Signature_Tests);
BOTAN_REGISTER_TEST("xmss_verify", XMSS_Signature_Verify_Tests);
+BOTAN_REGISTER_TEST("xmss_keygen", XMSS_Keygen_Tests);
#endif