Skip to content

Commit 6c1f0b2

Browse files
committed
doc: simplify test for bitflips
1 parent 033d894 commit 6c1f0b2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/tests/test_validation_criteria.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,12 @@ mod proof_validation {
252252
assert!(nizk.verify_batchable(&proof).is_ok());
253253

254254
// Test bitflips at various positions
255-
let positions = [0, proof.len() / 2, proof.len() - 1];
256-
257-
for &pos in &positions {
255+
for pos in 0 .. proof.len() {
258256
let original_byte = proof[pos];
259257

260258
// Flip each bit in the byte
261259
for bit in 0..8 {
262-
proof[pos] = original_byte ^ (1 << bit);
260+
proof[pos] ^= 1 << bit;
263261

264262
// Verification should fail
265263
assert!(

0 commit comments

Comments
 (0)