Skip to content

Commit

Permalink
Bulletproofs+: gcc compilation fix + minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sowle committed Jun 8, 2021
1 parent d38c852 commit ca10d2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/crypto/range_proofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// Namely, Bulletproofs+ https://eprint.iacr.org/2020/735.pdf
//

#include "epee/include/misc_log_ex.h"
#include "crypto-sugar.h"

namespace crypto
Expand Down Expand Up @@ -140,8 +141,8 @@ namespace crypto
const size_t c_bpp_mn = c_bpp_m * c_bpp_n;
const size_t c_bpp_log2_mn = c_bpp_log2_m + c_bpp_log2_n;

// TODO: multiply values and masks by c_scalar_1div8
// in order to enforce that points in verify() after mul by 8 will be in the prime-order subgroup
// pre-multiply all output points by c_scalar_1div8
// in order to enforce these points to be in the prime-order subgroup (after mul by 8 in bpp_verify())

// calc commitments vector as commitments[i] = 1/8 * values[i] * G + 1/8 * masks[i] * H
commitments.resize(values.size());
Expand Down Expand Up @@ -778,7 +779,7 @@ namespace crypto
DBG_PRINT("H_scalar: " << H_scalar);

// uncommon generators' multiplicands
point_t summand_8 = c_point_0; // this summand to be multiplied by 8 and rwf before adding to the main summand
point_t summand_8 = c_point_0; // this summand to be multiplied by 8 before adding to the main summand
// - rwf * e^2 * A0
summand_8 -= rwf * interm.e_final_sq * interm.A0;
DBG_PRINT("A0_scalar: " << c_scalar_Lm1 * interm.e_final_sq * rwf);
Expand Down
2 changes: 1 addition & 1 deletion tests/functional_tests/crypto_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ TEST(crypto, hex_tools)

TEST(crypto, calc_lsb_32)
{
auto& local_calc_lsb = [](uint32_t v) {
auto local_calc_lsb = [](uint32_t v) {
uint8_t r = 0;
while (v != 0 && (v & 1) == 0)
{
Expand Down

0 comments on commit ca10d2d

Please sign in to comment.