aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/curve25519/curve25519.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-20 11:01:03 -0500
committerJack Lloyd <[email protected]>2020-11-28 08:03:14 -0500
commit0c76f906a3083b9f4662e89508325e1dd474c7c3 (patch)
treef4c846c132feaaa22c9f5ff5563429671bea0668 /src/lib/pubkey/curve25519/curve25519.cpp
parentb00cd7cea9233b782697f645a5aa54fd59ecacd9 (diff)
Add Private_Key::public_key
Diffstat (limited to 'src/lib/pubkey/curve25519/curve25519.cpp')
-rw-r--r--src/lib/pubkey/curve25519/curve25519.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp
index 515fdc5e6..a06e700c4 100644
--- a/src/lib/pubkey/curve25519/curve25519.cpp
+++ b/src/lib/pubkey/curve25519/curve25519.cpp
@@ -87,6 +87,11 @@ Curve25519_PrivateKey::Curve25519_PrivateKey(const AlgorithmIdentifier&,
curve25519_basepoint(m_public.data(), m_private.data());
}
+std::unique_ptr<Public_Key> Curve25519_PrivateKey::public_key() const
+ {
+ return std::unique_ptr<Public_Key>(new Curve25519_PublicKey(public_value()));
+ }
+
secure_vector<uint8_t> Curve25519_PrivateKey::private_key_bits() const
{
return DER_Encoder().encode(m_private, OCTET_STRING).get_contents();