Skip to content

Commit

Permalink
bulletproofs+: some minor cleanup from vtnerd's review
Browse files Browse the repository at this point in the history
  • Loading branch information
moneromooo-monero committed Apr 5, 2022
1 parent 4c94cfe commit 5acdd0e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/ringct/bulletproofs_plus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ namespace rct

rct::key res = ONE;
if (n == 1)
return res;
return x;

n += 1;
rct::key x1 = copy(x);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5acdd0e

Please sign in to comment.