Skip to content

fix: R1CS binding in transcript [LA - I]#363

Merged
ashpect merged 1 commit into
v1from
ash/audit1
Mar 26, 2026
Merged

fix: R1CS binding in transcript [LA - I]#363
ashpect merged 1 commit into
v1from
ash/audit1

Conversation

@ashpect
Copy link
Copy Markdown
Collaborator

@ashpect ashpect commented Mar 21, 2026

Problem
The Fiat-Shamir domain separator was initialized with an empty instance (Empty), so the transcript never absorbed a digest of the concrete R1CS or the public inputs being proven. In a setting where a verifier could be presented with different circuits or verification keys, challenges would be identical across them, allowing cross-circuit or cross-key confusion.

Fix
Added R1CS::hash() (SHA3-256 over the serialized R1CS) and stored the hash in WhirR1CSScheme at prepare time.

Changed the domain separator instance from Empty to public_inputs.hash_bytes() in both prover and verifier, binding the public statement to the transcript.

Added PublicInputs::hash_bytes() for the byte-level hash used as instance data.

Moved public input extraction earlier in the prover (derived from the ACIR witness map before witness solve) so it's available for transcript setup.

@ashpect ashpect changed the base branch from main to v1 March 21, 2026 19:07
@ashpect ashpect added LA-audit and removed LA-audit labels Mar 21, 2026
@ashpect ashpect merged commit 05a5c1e into v1 Mar 26, 2026
dcbuild3r pushed a commit that referenced this pull request May 16, 2026
fix: R1CS binding in transcript [LA - I]
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.

2 participants