diff --git a/src/apps/monero/protocol/tsx_sign_builder.py b/src/apps/monero/protocol/tsx_sign_builder.py index 466081b3a..5b503b325 100644 --- a/src/apps/monero/protocol/tsx_sign_builder.py +++ b/src/apps/monero/protocol/tsx_sign_builder.py @@ -562,7 +562,6 @@ async def set_input(self, src_entr): pseudo_out = None pseudo_out_hmac = None alpha_enc = None - spend_enc = None if self.use_simple_rct: alpha, pseudo_out = self._gen_commitment(src_entr.amount) @@ -896,7 +895,7 @@ def _range_proof(self, idx, amount, rsig_data=None): self.output_masks = [] return rsig, mask - def _set_out1_ecdh(self, idx, dest_pub_key, amount, mask, amount_key): + def _set_out1_ecdh(self, dest_pub_key, amount, mask, amount_key): from apps.monero.xmr import ring_ct # Mask sum @@ -1046,7 +1045,6 @@ async def set_out1(self, dst_entr, dst_entr_hmac, rsig_data=None): # Out_pk, ecdh_info out_pk, ecdh_info_bin = self._set_out1_ecdh( - self.out_idx, dest_pub_key=tx_out_key, amount=dst_entr.amount, mask=mask, @@ -1331,7 +1329,6 @@ async def sign_input( gc.collect() from apps.monero.xmr import mlsag2 - mg = None if self.use_simple_rct: # Simple RingCT mix_ring = [x.key for x in src_entr.outputs] diff --git a/src/apps/monero/xmr/mlsag2.py b/src/apps/monero/xmr/mlsag2.py index ef8d0ca00..14bdd33c9 100644 --- a/src/apps/monero/xmr/mlsag2.py +++ b/src/apps/monero/xmr/mlsag2.py @@ -23,7 +23,7 @@ def scalar_gen_vector(n): """ Generates vector of scalars """ - return [crypto.random_scalar() for i in range(0, n)] + return [crypto.random_scalar() for _ in range(0, n)] # diff --git a/src/apps/monero/xmr/monero.py b/src/apps/monero/xmr/monero.py index ac7c50851..b3351ccd7 100644 --- a/src/apps/monero/xmr/monero.py +++ b/src/apps/monero/xmr/monero.py @@ -123,7 +123,6 @@ def generate_tx_spend_and_key_image( # step 2: add Hs(SubAddr || a || index_major || index_minor) subaddr_sk = None - scalar_step2 = None if received_index == (0, 0): scalar_step2 = scalar_step1 else: diff --git a/src/apps/monero/xmr/ring_ct.py b/src/apps/monero/xmr/ring_ct.py index f77c3a58b..8294d16a3 100644 --- a/src/apps/monero/xmr/ring_ct.py +++ b/src/apps/monero/xmr/ring_ct.py @@ -6,15 +6,6 @@ from apps.monero.xmr import crypto -def bp_size(outputs): - M, logM = 1, 0 - while M <= 16 and M < outputs: - logM += 1 - M = 1 << logM - - return 32 * (21 + outputs + 2 * logM) - - def prove_range_bp(amount, last_mask=None): mask = last_mask if last_mask is not None else crypto.random_scalar() bp_proof = prove_range_bp_batch([amount], [mask]) diff --git a/src/apps/monero/xmr/sub/recode.py b/src/apps/monero/xmr/sub/recode.py index b0cc22c13..7ebfa57dd 100644 --- a/src/apps/monero/xmr/sub/recode.py +++ b/src/apps/monero/xmr/sub/recode.py @@ -22,7 +22,7 @@ def recode_ecdh(ecdh, encode=True): def recode_msg(mgs, encode=True): """ Recodes MGs signatures from raw forms to bytearrays so it works with serialization - :param rv: + :param mgs: :param encode: if true encodes to byte representation, otherwise decodes from byte representation :return: """