Skip to content

Commit c6ae018

Browse files
author
AztecBot
committed
Merge branch 'next' into merge-train/spartan
2 parents 33dcab2 + b1c1d3e commit c6ae018

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

barretenberg/cpp/src/barretenberg/srs/factories/get_bn254_crs.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ size_t round_up_to_chunk_boundary(size_t num_points)
6969
* @details Verifies all complete chunks in parallel across available cores with early-exit
7070
* on first mismatch. Also verifies the partial last chunk (if present) so every downloaded byte
7171
* is covered. Uses std::span to avoid per-chunk memory allocation.
72+
*
73+
* @note Intentionally invoked from a single site — `download_bn254_g1_data` below — and not from
74+
* the cache-hit, MemBn254Crs ctor, or `bbapi::SrsInitSrs` paths. This is the only path that
75+
* (a) fetches CRS bytes over plain HTTP, and (b) does not consume bytes that have already been
76+
* hash-verified upstream:
77+
* - the cache-hit paths (uncompressed and compressed) read bytes that were verified by this
78+
* function on a previous run before being cached;
79+
* - `bbapi::SrsInitSrs` (bb.js / WASM) receives bytes that bb.js itself fetched over HTTPS,
80+
* where TLS provides transport integrity;
81+
* - `MemBn254Crs` is constructed in-process from already-validated points.
82+
* Therefore re-anchoring at every additional call site is redundant; this anchor exists
83+
* specifically to compensate for the plain-HTTP fetch on the fresh-download path.
7284
*/
7385
void verify_bn254_crs_integrity(const std::vector<uint8_t>& data)
7486
{

0 commit comments

Comments
 (0)