diff options
Diffstat (limited to 'src/tests/test_dh.cpp')
-rw-r--r-- | src/tests/test_dh.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/src/tests/test_dh.cpp b/src/tests/test_dh.cpp index 7377fa1e4..028a4d1cc 100644 --- a/src/tests/test_dh.cpp +++ b/src/tests/test_dh.cpp @@ -7,9 +7,9 @@ #include "tests.h" #if defined(BOTAN_HAS_DIFFIE_HELLMAN) - #include "test_pubkey.h" - #include <botan/pubkey.h> - #include <botan/dh.h> + #include "test_pubkey.h" + #include <botan/pubkey.h> + #include <botan/dh.h> #endif namespace Botan_Tests { @@ -21,14 +21,17 @@ namespace { class Diffie_Hellman_KAT_Tests : public PK_Key_Agreement_Test { public: - Diffie_Hellman_KAT_Tests() : PK_Key_Agreement_Test( - "Diffie-Hellman", - "pubkey/dh.vec", - "P,G,X,Y,Msg,OutLen,K", - "Q,KDF") - {} - - std::string default_kdf(const VarMap&) const override { return "Raw"; } + Diffie_Hellman_KAT_Tests() + : PK_Key_Agreement_Test( + "Diffie-Hellman", + "pubkey/dh.vec", + "P,G,X,Y,Msg,OutLen,K", + "Q,KDF") {} + + std::string default_kdf(const VarMap&) const override + { + return "Raw"; + } std::unique_ptr<Botan::Private_Key> load_our_key(const std::string&, const VarMap& vars) override { @@ -114,7 +117,10 @@ class DH_Invalid_Key_Tests : public Text_Based_Test DH_Invalid_Key_Tests() : Text_Based_Test("pubkey/dh_invalid.vec", "P,Q,G,InvalidKey") {} - bool clear_between_callbacks() const override { return false; } + bool clear_between_callbacks() const override + { + return false; + } Test::Result run_one_test(const std::string&, const VarMap& vars) override { @@ -135,8 +141,14 @@ class DH_Invalid_Key_Tests : public Text_Based_Test class Diffie_Hellman_Keygen_Tests : public PK_Key_Generation_Test { public: - std::vector<std::string> keygen_params() const override { return { "modp/ietf/1024", "modp/ietf/2048" }; } - std::string algo_name() const override { return "DH"; } + std::vector<std::string> keygen_params() const override + { + return { "modp/ietf/1024", "modp/ietf/2048" }; + } + std::string algo_name() const override + { + return "DH"; + } }; BOTAN_REGISTER_TEST("dh_kat", Diffie_Hellman_KAT_Tests); |