aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ecdh
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-12 19:03:18 -0400
committerJack Lloyd <[email protected]>2018-08-12 19:03:18 -0400
commitc3b40191a0406b6d8f7d1480d06344067622e2c1 (patch)
tree4ad369713128d0787cdf9b0b46d95a92925770af /src/lib/pubkey/ecdh
parentf21693a2499e10fae7a07f7d80178874115a185c (diff)
Add function to return the size of a key agreement output
Very useful when using "Raw" DH/ECDH via the FFI API.
Diffstat (limited to 'src/lib/pubkey/ecdh')
-rw-r--r--src/lib/pubkey/ecdh/ecdh.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/pubkey/ecdh/ecdh.cpp b/src/lib/pubkey/ecdh/ecdh.cpp
index 59f245a00..e7e49a74f 100644
--- a/src/lib/pubkey/ecdh/ecdh.cpp
+++ b/src/lib/pubkey/ecdh/ecdh.cpp
@@ -34,6 +34,8 @@ class ECDH_KA_Operation final : public PK_Ops::Key_Agreement_with_KDF
m_l_times_priv = m_group.inverse_mod_order(m_group.get_cofactor()) * key.private_value();
}
+ size_t agreed_value_size() const override { return m_group.get_p_bytes(); }
+
secure_vector<uint8_t> raw_agree(const uint8_t w[], size_t w_len) override
{
PointGFp input_point = m_group.get_cofactor() * m_group.OS2ECP(w, w_len);