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

Commit

Permalink
xmr: bp - minor memory optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Aug 17, 2018
1 parent e45fda6 commit 42877b0
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/apps/monero/xmr/bulletproof.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,22 +679,21 @@ def prove_s1(self, V, A, S, T1, T2, taux, mu, t, x_ip, y, hash_cache, l, r):
sc_add(t0, t0, k)
self.gc(3)

# step 2
vpIz = vector_scalar(self.oneN, z)
aL_vpIz = vector_subtract(self.v_aL, vpIz)
aR_vpIz = vector_add(self.v_aR, vpIz)
del vpIz
# step 2, tmp_vct = vpIz
tmp_vct = _ensure_dst_keyvect(None, BP_N)
vector_scalar(self.oneN, z, tmp_vct)
aL_vpIz = vector_subtract(self.v_aL, tmp_vct)
aR_vpIz = vector_add(self.v_aR, tmp_vct)
self.gc(4)

HyNsR = hadamard(yN, self.v_sR)
ip1 = inner_product(aL_vpIz, HyNsR)
ip3 = inner_product(self.v_sL, HyNsR)
del HyNsR
# tmp_vct = HyNsR
hadamard(yN, self.v_sR, tmp_vct)
ip1 = inner_product(aL_vpIz, tmp_vct)
ip3 = inner_product(self.v_sL, tmp_vct)
self.gc(5)

sc_add(t1, t1, ip1)

tmp_vct = _ensure_dst_keyvect(None, BP_N)
vp2zsq = vector_scalar(self.twoN, zsq)

# Originally:
Expand Down

0 comments on commit 42877b0

Please sign in to comment.