diff options
Diffstat (limited to 'src/lib/pubkey/pk_algs.cpp')
-rw-r--r-- | src/lib/pubkey/pk_algs.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/pubkey/pk_algs.cpp b/src/lib/pubkey/pk_algs.cpp index e7d744ae9..7cccd0168 100644 --- a/src/lib/pubkey/pk_algs.cpp +++ b/src/lib/pubkey/pk_algs.cpp @@ -52,6 +52,10 @@ #include <botan/mceliece.h> #endif +#if defined(BOTAN_HAS_XMSS) + #include <botan/xmss.h> +#endif + namespace Botan { std::unique_ptr<Public_Key> @@ -117,6 +121,11 @@ load_public_key(const AlgorithmIdentifier& alg_id, return std::unique_ptr<Public_Key>(new GOST_3410_PublicKey(alg_id, key_bits)); #endif +#if defined(BOTAN_HAS_XMSS) + if(alg_name == "XMSS") + return std::unique_ptr<Public_Key>(new XMSS_PublicKey(key_bits)); +#endif + throw Decoding_Error("Unhandled PK algorithm " + alg_name); } @@ -183,6 +192,11 @@ load_private_key(const AlgorithmIdentifier& alg_id, return std::unique_ptr<Private_Key>(new ElGamal_PrivateKey(alg_id, key_bits)); #endif +#if defined(BOTAN_HAS_XMSS) + if(alg_name == "XMSS") + return std::unique_ptr<Private_Key>(new XMSS_PrivateKey(key_bits)); +#endif + throw Decoding_Error("Unhandled PK algorithm " + alg_name); } @@ -224,6 +238,14 @@ create_private_key(const std::string& alg_name, } #endif +#if defined(BOTAN_HAS_XMSS) + if(alg_name == "XMSS") + { + return std::unique_ptr<Private_Key>( + new XMSS_PrivateKey(XMSS_Parameters(params).oid(), rng)); + } +#endif + // ECC crypto #if defined(BOTAN_HAS_ECC_PUBLIC_KEY_CRYPTO) |