aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ecdh/ecdh.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-03-10 10:24:25 -0500
committerJack Lloyd <[email protected]>2018-03-10 10:27:12 -0500
commit9141f982c7679a27a265a84ba34d9695017883c9 (patch)
tree2853c6c86ab7ac70dde74692a82ec01c15bbbb20 /src/lib/pubkey/ecdh/ecdh.h
parentea0f46dfcab59938fc863ca8d01552392c3c5a34 (diff)
Add PointGFp::encode as replacement for EC2OSP
Literally every single call to EC2OSP is converting the returned secure_vector to a std::vector. Which makes sense since private points are not really a thing in any protocol I know of.
Diffstat (limited to 'src/lib/pubkey/ecdh/ecdh.h')
-rw-r--r--src/lib/pubkey/ecdh/ecdh.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/pubkey/ecdh/ecdh.h b/src/lib/pubkey/ecdh/ecdh.h
index d967c749f..f88955ac4 100644
--- a/src/lib/pubkey/ecdh/ecdh.h
+++ b/src/lib/pubkey/ecdh/ecdh.h
@@ -48,13 +48,13 @@ class BOTAN_PUBLIC_API(2,0) ECDH_PublicKey : public virtual EC_PublicKey
* @return public point value
*/
std::vector<uint8_t> public_value() const
- { return unlock(EC2OSP(public_point(), PointGFp::UNCOMPRESSED)); }
+ { return public_point().encode(PointGFp::UNCOMPRESSED); }
/**
* @return public point value
*/
- std::vector<uint8_t> public_value(PointGFp::Compression_Type type) const
- { return unlock(EC2OSP(public_point(), static_cast<uint8_t>(type))); }
+ std::vector<uint8_t> public_value(PointGFp::Compression_Type format) const
+ { return public_point().encode(format); }
protected:
ECDH_PublicKey() = default;