Skip to content

Commit

Permalink
xmr: bp optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Aug 24, 2018
1 parent dd69eb1 commit 5060d6a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/apps/monero/xmr/bulletproof.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,9 +1255,12 @@ def _prove_batch_main(self, V, gamma, aL, aR, hash_cache, logM, logN, M, N):
# Polynomial construction before PAPER LINE 46
t1_1 = inner_product(l0, r1)
t1_2 = inner_product(l1, r0)
self.gc(17)

t1 = sc_add(None, t1_1, t1_2)
t2 = inner_product(l1, r1)
del (t1_1, t1_2)
self.gc(17)

# PAPER LINES 47-48
tau1, tau2 = sc_gen(), sc_gen()
Expand Down Expand Up @@ -1398,27 +1401,27 @@ def _prove_batch_main(self, V, gamma, aL, aR, hash_cache, logM, logN, M, N):

vector_scalar2(Gprime.slice_view(0, nprime), winv, _tmp_vct_1)
vector_scalar2(Gprime.slice_view(nprime, npr2), w[round], _tmp_vct_2)
hadamard2(_tmp_vct_1, _tmp_vct_2, Gprime)
Gprime.resize(nprime, chop=True)
hadamard2(_tmp_vct_1, _tmp_vct_2, Gprime)
self.gc(27)

vector_scalar2(Hprime.slice_view(0, nprime), w[round], _tmp_vct_1)
vector_scalar2(Hprime.slice_view(nprime, npr2), winv, _tmp_vct_2)
hadamard2(_tmp_vct_1, _tmp_vct_2, Hprime)
Hprime.resize(nprime, chop=True)
hadamard2(_tmp_vct_1, _tmp_vct_2, Hprime)
self.gc(28)

# PAPER LINES 28-29
vector_scalar(aprime.slice_view(0, nprime), w[round], _tmp_vct_1)
vector_scalar(aprime.slice_view(nprime, npr2), winv, _tmp_vct_2)
vector_add(_tmp_vct_1, _tmp_vct_2, aprime)
aprime.resize(nprime, chop=True)
vector_add(_tmp_vct_1, _tmp_vct_2, aprime)
self.gc(29)

vector_scalar(bprime.slice_view(0, nprime), winv, _tmp_vct_1)
vector_scalar(bprime.slice_view(nprime, npr2), w[round], _tmp_vct_2)
vector_add(_tmp_vct_1, _tmp_vct_2, bprime)
bprime.resize(nprime, chop=True)
vector_add(_tmp_vct_1, _tmp_vct_2, bprime)

round += 1
self.gc(30)
Expand Down

0 comments on commit 5060d6a

Please sign in to comment.