diff --git a/src/crypto/range_proofs.h b/src/crypto/range_proofs.h index 7478e64b6..b3d04d68f 100644 --- a/src/crypto/range_proofs.h +++ b/src/crypto/range_proofs.h @@ -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 @@ -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()); @@ -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); diff --git a/tests/functional_tests/crypto_tests.cpp b/tests/functional_tests/crypto_tests.cpp index b70c53905..f5ea3a8e1 100644 --- a/tests/functional_tests/crypto_tests.cpp +++ b/tests/functional_tests/crypto_tests.cpp @@ -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) {