aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ecdh
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-09-28 13:06:36 +0200
committerRenĂ© Korthaus <[email protected]>2016-10-03 12:18:24 +0200
commitf38841305ecd3fd0d13285823497a5a9d3b5c19f (patch)
treed01a3263baa7df488cf58fc997d1c9710dbfb0a4 /src/lib/pubkey/ecdh
parentab2842d6f28680b1cac18d5ff6b70b395d1ffb65 (diff)
Support encoding of supported point formats extension
Diffstat (limited to 'src/lib/pubkey/ecdh')
-rw-r--r--src/lib/pubkey/ecdh/ecdh.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/pubkey/ecdh/ecdh.h b/src/lib/pubkey/ecdh/ecdh.h
index 2f892436c..bdd9ea047 100644
--- a/src/lib/pubkey/ecdh/ecdh.h
+++ b/src/lib/pubkey/ecdh/ecdh.h
@@ -55,6 +55,12 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey
std::vector<byte> public_value() const
{ return unlock(EC2OSP(public_point(), PointGFp::UNCOMPRESSED)); }
+ /**
+ * @return public point value
+ */
+ std::vector<byte> public_value(PointGFp::Compression_Type type) const
+ { return unlock(EC2OSP(public_point(), type)); }
+
protected:
ECDH_PublicKey();
};
@@ -84,7 +90,10 @@ class BOTAN_DLL ECDH_PrivateKey : public ECDH_PublicKey,
EC_PrivateKey(rng, domain, x) {}
std::vector<byte> public_value() const override
- { return ECDH_PublicKey::public_value(); }
+ { return ECDH_PublicKey::public_value(PointGFp::UNCOMPRESSED); }
+
+ std::vector<byte> public_value(PointGFp::Compression_Type type) const
+ { return ECDH_PublicKey::public_value(type); }
};
}