From f60c42cd94789a05cd75f6497acb1b2ec37a92cc Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 12 Jun 2016 15:39:04 +0300 Subject: [PATCH] Add ECDH support to client --- trezorlib/client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/trezorlib/client.py b/trezorlib/client.py index f2332865c..7d5eafbec 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -508,6 +508,10 @@ class ProtocolMixin(object): def sign_identity(self, identity, challenge_hidden, challenge_visual, ecdsa_curve_name=DEFAULT_CURVE): return self.call(proto.SignIdentity(identity=identity, challenge_hidden=challenge_hidden, challenge_visual=challenge_visual, ecdsa_curve_name=ecdsa_curve_name)) + @expect(proto.ECDHSessionKey) + def get_ecdh_session_key(self, identity, peer_public_key, ecdsa_curve_name=DEFAULT_CURVE): + return self.call(proto.GetECDHSessionKey(identity=identity, peer_public_key=peer_public_key, ecdsa_curve_name=ecdsa_curve_name)) + def verify_message(self, address, signature, message): # Convert message to UTF8 NFC (seems to be a bitcoin-qt standard) message = normalize_nfc(message)