Skip to content

Commit

Permalink
xmr: range_sig allocation reordering, large chunks first
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Sep 27, 2018
1 parent 63cddd5 commit df0a1df
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/apps/monero/xmr/ring_ct.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ def verify_bp(bp_proof, amounts=None, masks=None):


def prove_range_chunked(amount, last_mask=None):
# The large chunks allocated first to avoid potential memory fragmentation issues.
ai = bytearray(32 * 64)
alphai = bytearray(32 * 64)
Cis = bytearray(32 * 64)
s0s = bytearray(32 * 64)
s1s = bytearray(32 * 64)
buff = bytearray(32)
ee_bin = bytearray(32)

a = crypto.sc_init(0)
si = crypto.sc_init(0)
c = crypto.sc_init(0)
Expand All @@ -67,15 +76,6 @@ def prove_range_chunked(amount, last_mask=None):
Zero = crypto.identity()
kck = crypto.get_keccak()

ai = bytearray(32 * 64)
alphai = bytearray(32 * 64)
buff = bytearray(32)

Cis = bytearray(32 * 64)
s0s = bytearray(32 * 64)
s1s = bytearray(32 * 64)
ee_bin = bytearray(32)

for ii in range(64):
crypto.random_scalar(tmp_ai)
if last_mask is not None and ii == 63:
Expand Down

0 comments on commit df0a1df

Please sign in to comment.