Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
xmr: PreMlsagHasher - KeyV import removed, comment added
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Oct 2, 2018
1 parent 9a194fa commit 69bbf5f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/apps/monero/xmr/sub/mlsag_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ def set_pseudo_out(self, out):
raise ValueError("State error")
self.state = 3

from apps.monero.xmr.serialize_messages.ct_keys import KeyV

self.rtcsig_hasher.field(out, KeyV.ELEM_TYPE)
# Manual serialization of the KeyV = Container of ECKeys
self.rtcsig_hasher.uvarint(len(out))
for x in out:
self.rtcsig_hasher.buffer(x)

def set_ecdh(self, ecdh):
if self.state != 2 and self.state != 3 and self.state != 4:
Expand Down Expand Up @@ -71,6 +72,10 @@ def rsig_val(self, p, bulletproof, raw=False):
raise ValueError("State error")

if raw:
# Avoiding problem with the memory fragmentation.
# If the range proof is passed as a list, hash each element
# as the range proof is split to multiple byte arrays while
# preserving the byte ordering
if isinstance(p, list):
for x in p:
self.rsig_hasher.update(x)
Expand Down

0 comments on commit 69bbf5f

Please sign in to comment.