From a0d80b1f95cee64edfeba799f4fe9b8fb2ef4f43 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 17 Dec 2020 11:57:53 +0000 Subject: plug bulletproofs plus into consensus --- src/ringct/bulletproofs_plus.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/ringct/bulletproofs_plus.cc') diff --git a/src/ringct/bulletproofs_plus.cc b/src/ringct/bulletproofs_plus.cc index fd2ebfce0..589e58525 100644 --- a/src/ringct/bulletproofs_plus.cc +++ b/src/ringct/bulletproofs_plus.cc @@ -65,7 +65,7 @@ namespace rct // Proof bounds static constexpr size_t maxN = 64; // maximum number of bits in range - static constexpr size_t maxM = BULLETPROOF_MAX_OUTPUTS; // maximum number of outputs to aggregate into a single proof + static constexpr size_t maxM = BULLETPROOF_PLUS_MAX_OUTPUTS; // maximum number of outputs to aggregate into a single proof // Cached public generators static rct::key Hi[maxN*maxM], Gi[maxN*maxM]; @@ -796,15 +796,7 @@ try_again: rct::keyV sv(v.size()); for (size_t i = 0; i < v.size(); ++i) { - sv[i] = rct::zero(); - sv[i].bytes[0] = v[i] & 255; - sv[i].bytes[1] = (v[i] >> 8) & 255; - sv[i].bytes[2] = (v[i] >> 16) & 255; - sv[i].bytes[3] = (v[i] >> 24) & 255; - sv[i].bytes[4] = (v[i] >> 32) & 255; - sv[i].bytes[5] = (v[i] >> 40) & 255; - sv[i].bytes[6] = (v[i] >> 48) & 255; - sv[i].bytes[7] = (v[i] >> 56) & 255; + sv[i] = rct::d2h(v[i]); } return bulletproof_plus_PROVE(sv, gamma); } @@ -836,7 +828,7 @@ try_again: // We'll perform only a single batch inversion across all proofs in the batch, // since batch inversion requires only one scalar inversion operation. std::vector to_invert; - to_invert.reserve(11 * sizeof(proofs)); // maximal size, given the aggregation limit + to_invert.reserve(11 * proofs.size()); // maximal size, given the aggregation limit for (const BulletproofPlus *p: proofs) { -- cgit v1.2.3