Skip to content

feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based#21113

Merged
ludamad merged 7 commits intomerge-train/barretenbergfrom
claudebox/hybrid-crs-hash-verification
Mar 4, 2026
Merged

feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based#21113
ludamad merged 7 commits intomerge-train/barretenbergfrom
claudebox/hybrid-crs-hash-verification

Conversation

@AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Mar 4, 2026

Adds SHA-256 chunk hash verification for BN254 CRS downloads, combining the best of #21087 and #20864.

  • 8MB chunks (131K points each, 257 hashes embedded at compile time)
  • Parallel verification with atomic early-exit on first mismatch
  • std::span-based hashing (zero per-chunk allocation)
  • Retains fast first-element sanity check before full hash verification
  • Covers partial last chunk (64-byte tail) so every downloaded byte is verified
  • Primary/fallback CDN URLs with HTTP Range requests

johnathan79717 and others added 4 commits February 25, 2026 15:45
Adds integrity verification for BN254 G1 SRS downloads using SHA-256
chunk hashes. The SRS is divided into 2MB chunks (2^15 points each),
and the SHA-256 hash of each chunk is embedded in the binary. After
downloading, every chunk is verified against the hash table.

Downloads are rounded up to the next chunk boundary so every downloaded
byte falls within a complete chunk and is hash-verified. The worst-case
over-download is 2MB (<0.05% for typical downloads).

Closes AztecProtocol/barretenberg#1628
@AztecBot AztecBot added the claudebox Owned by claudebox. it can push to this PR. label Mar 4, 2026
@johnathan79717 johnathan79717 self-requested a review March 4, 2026 16:44
@johnathan79717 johnathan79717 changed the base branch from next to merge-train/barretenberg March 4, 2026 16:45
@johnathan79717 johnathan79717 marked this pull request as ready for review March 4, 2026 16:51
@ludamad ludamad merged commit 750ca79 into merge-train/barretenberg Mar 4, 2026
10 checks passed
@ludamad ludamad deleted the claudebox/hybrid-crs-hash-verification branch March 4, 2026 17:26
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
fix: add -g0 to zig presets to eliminate 11GB debug info bloat (#21071)
fix: resolve flaky p2p_client test race condition on ARM64 (#21088)
chore: remove domain iteration macros and address backing memory race
(#20988)
fix: [ECCVM] added domain separation for the multiset equality check.
(#20352)
feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based
(#21113)
chore: unify splitting scalars interface (#20805)
chore: add a unique id to each origin tag (#20924)
chore: Native curve audit (#20936)
chore: Update bootstrap in test vk haven't changed script (#21153)
fix: use reduced form in WASM FromMontgomeryForm test (#21164)
chore: erase ephemeral secrets from memory in schnorr and aes (#21106)
chore: suppress clangd target triple version diagnostic (#21180)
feat: Optimise new claim calculation (#21179)
docs: add Quick Start build instructions to barretenberg README (#20951)
feat: batched chonk verification (#21083)
fix: link libc++ instead of libstdc++ for Rust FFI on Linux (#21203)
fix: [ECCVM] in the transcript table, no-ops force the next accumulator
to be 0. (#20849)
fix: resolve merge-train conflict with next (zig wrapper scripts + -g0)
(#21201)
fix: [ECCVM] rare edge case completeness issue when `z1 == 0` but `z2 !=
0` (#20858)
fix: use actual data extent for CommitmentKey in HypernovaDeciderProver
(#21206)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants