Skip to content

Commit 3c42a85

Browse files
author
notnotraju
committed
fix: use BB_ASSERT_EQ instead of BB_ASSERT for WNAF scalar sum check
BB_ASSERT(scalar_sum - entry.wnaf_skew, entry.scalar) checks whether the first argument is non-zero (truthiness), silently ignoring the second argument. The intent is to verify equality, so use BB_ASSERT_EQ which actually compares the two values and reports both on failure. Builder-only, not a constraint — no soundness impact.
1 parent 28b8833 commit 3c42a85

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

barretenberg/cpp/src/barretenberg/eccvm/precomputed_tables_builder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class ECCVMPointTablePrecomputationBuilder {
116116
row.pc = entry.pc;
117117

118118
if (last_row) {
119-
BB_ASSERT(scalar_sum - entry.wnaf_skew, entry.scalar);
119+
BB_ASSERT_EQ(scalar_sum - entry.wnaf_skew, entry.scalar);
120120
}
121121
// the last element of the `precomputed_table` field of a `ScalarMul` is the double of the point.
122122
row.precompute_double = entry.precomputed_table[bb::eccvm::POINT_TABLE_SIZE];

0 commit comments

Comments
 (0)