aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/curve25519/curve25519.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-04 10:04:02 -0400
committerJack Lloyd <[email protected]>2016-10-07 19:27:56 -0400
commit25b6fb53eec30620d084411fb1dbc8913142fc6d (patch)
tree6ffa291a3f4a74cac23bce304a42f4c26e33bcda /src/lib/pubkey/curve25519/curve25519.cpp
parent62cd6e3651711f759f870460599596ff5be904a5 (diff)
Remove Algo_Registry usage from public key code.
Instead the key types exposes operations like `create_encryption_op` which will return the relevant operation if the algorithm supports it. Changes pubkey.h interface, now RNG is passed at init time. Blinder previous created its own RNG, now it takes it from app.
Diffstat (limited to 'src/lib/pubkey/curve25519/curve25519.cpp')
-rw-r--r--src/lib/pubkey/curve25519/curve25519.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp
index aa0646d04..b1dfc59a1 100644
--- a/src/lib/pubkey/curve25519/curve25519.cpp
+++ b/src/lib/pubkey/curve25519/curve25519.cpp
@@ -5,8 +5,8 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/internal/pk_utils.h>
#include <botan/curve25519.h>
+#include <botan/internal/pk_ops_impl.h>
#include <botan/ber_dec.h>
#include <botan/der_enc.h>
@@ -134,9 +134,14 @@ class Curve25519_KA_Operation : public PK_Ops::Key_Agreement_with_KDF
const Curve25519_PrivateKey& m_key;
};
-BOTAN_REGISTER_PK_KEY_AGREE_OP("Curve25519", Curve25519_KA_Operation);
-
}
+std::unique_ptr<PK_Ops::Key_Agreement>
+Curve25519_PrivateKey::create_key_agreement_op(RandomNumberGenerator& /*rng*/,
+ const std::string& params,
+ const std::string& /*provider*/) const
+ {
+ return std::unique_ptr<PK_Ops::Key_Agreement>(new Curve25519_KA_Operation(*this, params));
+ }
}