Skip to content

Commit 2803219

Browse files
authored
fix: corrupt low-order bytes in batch verifier test to avoid non-canonical field encoding (#22333)
## Summary Fixes CI failure in `merge-train/barretenberg` caused by the interaction of #22233 (Fr::from_u64 big-endian encoding) and #22311 (strict non-canonical field validation). The `corruptProofFields()` test helper was flipping high-order bytes (indices 0,1) of field elements, creating values exceeding the BN254 Fr modulus. The strict validation now rejects these at deserialization time with `non-canonical encoding (value >= modulus)` before they reach the verifier. **Fix**: Flip low-order bytes (indices 30,31) instead — still corrupts the proof but keeps field values canonical. ## Test plan - [x] `batch_verifier.test.ts` — all 4 tests pass locally (previously 1 failing) ClaudeBox log: https://claudebox.work/s/e5146dc92fea29dd?run=1
1 parent 30bcb23 commit 2803219

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

yarn-project/ivc-integration/src/batch_verifier_test_helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { IVCProofVerificationResult } from '@aztec/stdlib/interfaces/server
55
export function corruptProofFields(fields: Uint8Array[]): Uint8Array[] {
66
const corrupted = fields.map(f => Uint8Array.from(f));
77
corrupted[2] = Uint8Array.from(corrupted[2]);
8-
corrupted[2][0] ^= 0xff;
9-
corrupted[2][1] ^= 0xff;
8+
corrupted[2][30] ^= 0xff;
9+
corrupted[2][31] ^= 0xff;
1010
return corrupted;
1111
}
1212

0 commit comments

Comments
 (0)