|
@ -33,14 +33,7 @@ class TrezorCompatibleKeyStore(Hardware_KeyStore): |
|
|
return self.plugin.get_client(self, force_pair) |
|
|
return self.plugin.get_client(self, force_pair) |
|
|
|
|
|
|
|
|
def decrypt_message(self, sequence, message, password): |
|
|
def decrypt_message(self, sequence, message, password): |
|
|
raise RuntimeError(_('Electrum and %s encryption and decryption are currently incompatible') % self.device) |
|
|
raise RuntimeError(_('Encryption and decryption are not implemented by %s') % self.device) |
|
|
client = self.get_client() |
|
|
|
|
|
address_path = self.get_derivation() + "/%d/%d"%sequence |
|
|
|
|
|
address_n = client.expand_path(address_path) |
|
|
|
|
|
payload = base64.b64decode(message) |
|
|
|
|
|
nonce, message, msg_hmac = payload[:33], payload[33:-8], payload[-8:] |
|
|
|
|
|
result = client.decrypt_message(address_n, nonce, message, msg_hmac) |
|
|
|
|
|
return result.message |
|
|
|
|
|
|
|
|
|
|
|
def sign_message(self, sequence, message, password): |
|
|
def sign_message(self, sequence, message, password): |
|
|
client = self.get_client() |
|
|
client = self.get_client() |
|
|