aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2022-05-10 16:51:59 -0500
committerluigi1111 <luigi1111w@gmail.com>2022-05-10 16:51:59 -0500
commitfbd1f1e476de88f391994a27a7dcca05adba4e7d (patch)
treed655d06de7f93ab1135f4ac1f7adf5de486177fd /src
parentMerge pull request #8281 (diff)
parentrefactor(bp+): save one inversion, use sc_muladd (diff)
downloadmonero-fbd1f1e476de88f391994a27a7dcca05adba4e7d.tar.xz
Merge pull request #8293
4f08bcd refactor(bp+): save one inversion, use sc_muladd (Dusan Klinec)
Diffstat (limited to 'src')
-rw-r--r--src/ringct/bulletproofs_plus.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ringct/bulletproofs_plus.cc b/src/ringct/bulletproofs_plus.cc
index 3d27849c1..231a88180 100644
--- a/src/ringct/bulletproofs_plus.cc
+++ b/src/ringct/bulletproofs_plus.cc
@@ -644,8 +644,7 @@ try_again:
{
sc_mul(temp.bytes, temp.bytes, z_squared.bytes);
sc_mul(temp2.bytes, y_powers[MN+1].bytes, temp.bytes);
- sc_mul(temp2.bytes, temp2.bytes, gamma[j].bytes);
- sc_add(alpha1.bytes, alpha1.bytes, temp2.bytes);
+ sc_muladd(alpha1.bytes, temp2.bytes, gamma[j].bytes, alpha1.bytes);
}
// These are used in the inner product rounds
@@ -706,7 +705,8 @@ try_again:
rct::key challenge_squared;
sc_mul(challenge_squared.bytes, challenge.bytes, challenge.bytes);
- rct::key challenge_squared_inv = invert(challenge_squared);
+ rct::key challenge_squared_inv;
+ sc_mul(challenge_squared_inv.bytes, challenge_inv.bytes, challenge_inv.bytes);
sc_muladd(alpha1.bytes, dL.bytes, challenge_squared.bytes, alpha1.bytes);
sc_muladd(alpha1.bytes, dR.bytes, challenge_squared_inv.bytes, alpha1.bytes);