Skip to content

chore: misc hash gadget updates #22452

Merged
ledwards2225 merged 5 commits into
merge-train/barretenbergfrom
lde/hahs-gadg-updates
Apr 10, 2026
Merged

chore: misc hash gadget updates #22452
ledwards2225 merged 5 commits into
merge-train/barretenbergfrom
lde/hahs-gadg-updates

Conversation

@ledwards2225

@ledwards2225 ledwards2225 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor
# Finding Resolution
3, 12 Msgpack NIL produces null shared_ptr, dereferenced in ACIR parsers Patched. NIL rejection in deserializer helpers, plus tests
6 result_infinite unconstrained in EC gadgets; prover could forge it Already fixed in PR #21865
9 assert_valid_variables debug-only, heap-allocated a vector per call Patched. Updated to use initializer_list/span to make cheap enough, always-on, (check in get_variable too expensive)
16 Sparse witness map amplifies ~10 bytes into ~137 GB allocation Accepted risk. No cap works without potentially rejecting valid inputs
20 UB shift-by-64 in get_wnaf_bits; hash tests Ultra-only Patched. Fixed UB, added Mega coverage to 4 test suites
21 Clang under-aligns NTTP objects, UB in barrett_reduction Patched. Root cause different than claimed in issue (see static_assert guards), Pointer NTTP refactor resolves UB per UBsan

@ledwards2225 ledwards2225 marked this pull request as ready for review April 10, 2026 20:34
@ledwards2225 ledwards2225 requested a review from ludamad April 10, 2026 20:35
Comment thread barretenberg/cpp/src/barretenberg/numeric/uintx/uintx.hpp
const uint64_t hi = spans_limbs ? (scalar[hi_limb_idx] << (64UL - lo_shift)) : 0UL;

return (lo & bit_mask) | (hi & hi_mask);
return (lo | hi) & bit_mask;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@ledwards2225 ledwards2225 merged commit b3e284c into merge-train/barretenberg Apr 10, 2026
34 checks passed
@ledwards2225 ledwards2225 deleted the lde/hahs-gadg-updates branch April 10, 2026 20:56
github-merge-queue Bot pushed a commit that referenced this pull request Apr 13, 2026
BEGIN_COMMIT_OVERRIDE
fix: skip heavy recursion tests in debug builds (#22446)
fix: add clear error for unsatisfiable ACIR AssertZero opcode (#22417)
feat: enforce accumulator_not_empty = 0 at ECCVM lagrange_first row
(#22461)
fix: skip heavy recursion tests in debug builds, keep one for assertion
coverage (#22389)
fix: external audit fixes for Pedersen (#22434)
chore!: fix BASE off-by-one in create_small_range_constraint in theta
step of keccak (#22404)
fix: external audit fixes for Keccak (#22436)
fix: external audit fixes for BLAKE (#22443)
chore: misc hash gadget updates  (#22452)
END_COMMIT_OVERRIDE
critesjosh pushed a commit that referenced this pull request Apr 14, 2026
| # | Finding | Resolution |
  |---|---------|------------|                                          
| 3, 12 | Msgpack NIL produces null `shared_ptr`, dereferenced in ACIR
parsers | **Patched.** NIL rejection in deserializer helpers, plus tests
|
| 6 | `result_infinite` unconstrained in EC gadgets; prover could forge
it | **Already fixed** in PR #21865 |
| 9 | `assert_valid_variables` debug-only, heap-allocated a vector per
call | **Patched.** Updated to use `initializer_list`/`span` to make
cheap enough, always-on, (check in `get_variable` too expensive) |
| 16 | Sparse witness map amplifies ~10 bytes into ~137 GB allocation |
**Accepted risk.** No cap works without potentially rejecting valid
inputs |
| 20 | UB shift-by-64 in `get_wnaf_bits`; hash tests Ultra-only |
**Patched.** Fixed UB, added Mega coverage to 4 test suites |
| 21 | Clang under-aligns NTTP objects, UB in `barrett_reduction` |
**Patched.** Root cause different than claimed in issue (see
`static_assert` guards), Pointer NTTP refactor resolves UB per UBsan |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants