You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix test to be independent of the query positions (#459)
The `WrongFriSibling` case in `test_verify` tampered with every value
in the last inner FRI layer's coset and then asserted that the error
contained `witness.0.last()[0][1]` — the value at a hardcoded coset
index of 1. This only held when the Fiat-Shamir-driven query bits
happened to pick index 1 in that coset; any change that reshuffled
query positions could silently shift the failing index and break the
test.
Rename the variant to `WrongFriWitness` (the tampered data is the
layer's witness, not just a Merkle sibling) and compute the coset
index from the query position and the fold-step schedule:
`selected_idx = (q >> cumulative_shift) & ((1 << last_step) - 1)`.
The cumulative shift comes from the same `compute_all_fold_steps`
helper that the prover-side `construct_fri_witness` uses, so the
test and the proof construction stay in sync.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments