Skip to content

Commit

Permalink
xmr: check input permutation
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Sep 17, 2018
1 parent 6fc8b0e commit 03e71de
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/apps/monero/protocol/tsx_sign_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,16 +602,6 @@ def tsx_inputs_done(self):
if self.inp_idx + 1 != self.num_inputs():
raise ValueError("Input count mismatch")

def tsx_inputs_done_inm(self):
"""
In-memory post processing - tx.vin[i] sorting by key image.
Used only if number of inputs is small - computable in Trezor without offloading.
"""
# Sort tx.in by key image
self.source_permutation = list(range(self.num_inputs()))
self.source_permutation.sort(key=lambda x: self.tx.vin[x].k_image, reverse=True)
self._tsx_inputs_permutation(self.source_permutation)

async def tsx_inputs_permutation(self, permutation):
"""
Set permutation on the inputs - sorted by key image on host.
Expand All @@ -631,6 +621,7 @@ def _tsx_inputs_permutation(self, permutation):
"""
self.state.input_permutation()
self.source_permutation = permutation
common.check_permutation(permutation)
self.inp_idx = -1

async def input_vini(self, src_entr, vini_bin, hmac, pseudo_out, pseudo_out_hmac):
Expand Down

0 comments on commit 03e71de

Please sign in to comment.