aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/bulletproofs_plus.cc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2021-11-05 10:22:38 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2022-04-05 18:50:23 +0000
commit5acdd0e2cbae777155ceb40b8835947d38f94c0c (patch)
tree1b249d56685115d46b65ebce4d1b39e2e0d0572b /src/ringct/bulletproofs_plus.cc
parentstore outPk/8 in the tx for speed (diff)
downloadmonero-5acdd0e2cbae777155ceb40b8835947d38f94c0c.tar.xz
bulletproofs+: some minor cleanup from vtnerd's review
Diffstat (limited to '')
-rw-r--r--src/ringct/bulletproofs_plus.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/ringct/bulletproofs_plus.cc b/src/ringct/bulletproofs_plus.cc
index 5aebba450..3d27849c1 100644
--- a/src/ringct/bulletproofs_plus.cc
+++ b/src/ringct/bulletproofs_plus.cc
@@ -265,7 +265,7 @@ namespace rct
rct::key res = ONE;
if (n == 1)
- return res;
+ return x;
n += 1;
rct::key x1 = copy(x);
@@ -317,16 +317,7 @@ namespace rct
static rct::key weighted_inner_product(const rct::keyV &a, const epee::span<const rct::key> &b, const rct::key &y)
{
CHECK_AND_ASSERT_THROW_MES(a.size() == b.size(), "Incompatible sizes of a and b");
- rct::key res = rct::zero();
- rct::key y_power = ONE;
- rct::key temp;
- for (size_t i = 0; i < a.size(); ++i)
- {
- sc_mul(temp.bytes, a[i].bytes, b[i].bytes);
- sc_mul(y_power.bytes, y_power.bytes, y.bytes);
- sc_muladd(res.bytes, temp.bytes, y_power.bytes, res.bytes);
- }
- return res;
+ return weighted_inner_product(epee::to_span(a), b, y);
}
// Fold inner-product point vectors