aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/pk_algs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pubkey/pk_algs.cpp')
-rw-r--r--src/lib/pubkey/pk_algs.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/pubkey/pk_algs.cpp b/src/lib/pubkey/pk_algs.cpp
index 9673199e0..e1784dd9f 100644
--- a/src/lib/pubkey/pk_algs.cpp
+++ b/src/lib/pubkey/pk_algs.cpp
@@ -44,6 +44,10 @@
#include <botan/ecdh.h>
#endif
+#if defined(BOTAN_HAS_CURVE_25519)
+ #include <botan/curve25519.h>
+#endif
+
namespace Botan {
Public_Key* make_public_key(const AlgorithmIdentifier& alg_id,
@@ -98,6 +102,11 @@ Public_Key* make_public_key(const AlgorithmIdentifier& alg_id,
return new ECDH_PublicKey(alg_id, key_bits);
#endif
+#if defined(BOTAN_HAS_CURVE_25519)
+ if(alg_name == "Curve25519")
+ return new Curve25519_PublicKey(alg_id, key_bits);
+#endif
+
return nullptr;
}
@@ -154,6 +163,11 @@ Private_Key* make_private_key(const AlgorithmIdentifier& alg_id,
return new ECDH_PrivateKey(alg_id, key_bits);
#endif
+#if defined(BOTAN_HAS_CURVE_25519)
+ if(alg_name == "Curve25519")
+ return new Curve25519_PrivateKey(alg_id, key_bits, rng);
+#endif
+
return nullptr;
}