Commit 32dbe90
committed
feat(fuzz): session 55 — per-system VK fuzz harnesses
Adds 5 new fuzz harnesses targeting the verifying-key parser of
each Phase-2 + Phase-3 system. Mirrors the session-54 proof-bytes
harness pattern but flips the role of the libfuzzer input: the
fuzz_target call swaps `data` into the VK slot while the proof and
public-inputs slots use the scaffold fixtures.
mosaic-fuzz/Cargo.toml — adds 5 new `[[bin]]` entries:
fuzz_plonk_vk_bytes
fuzz_hyperplonk_vk_bytes
fuzz_halo2_vk_bytes
fuzz_nova_vk_bytes
fuzz_stark_vk_bytes
5 new fuzz_target files in `fuzz_targets/`, each pinning the same
panic-free invariant on the system-specific VK parser:
- fuzz_plonk_vk_bytes — 744-byte fixed envelope; non-matching
lengths must surface as `Err(VerifyingKeyLengthMismatch)`.
- fuzz_hyperplonk_vk_bytes — 744-byte fixed envelope; the cross-
check `vk.num_variables == proof.sumcheck_rounds` adds a second
dimension the harness can flip.
- fuzz_halo2_vk_bytes — variable-length tail (fixed_commits ‖
permutation_commits). Empty IC equivalents (zero-length payload)
and oversized payloads are both expected to be rejected.
- fuzz_nova_vk_bytes — 235-byte fixed envelope plus the 3-way
`FoldingVariant::from_byte` tag rejection for bytes ∉ {0, 1, 2}.
- fuzz_stark_vk_bytes — 48-byte fixed envelope plus the
`StarkFieldId::from_byte` 3-way tag rejection plus the
structural cross-check against the scaffold proof shape.
After session 55 the fuzz harness inventory is 13 targets total:
Phase-1 (Groth16, 3 original)
fuzz_groth16_proof_bytes, fuzz_vk_bytes, fuzz_public_inputs
Phase-2 (KZG-PLONK, 2 new)
fuzz_plonk_proof_bytes, fuzz_plonk_vk_bytes
Phase-3 (HyperPlonk + Halo2 + Nova + STARK, 8 new)
fuzz_hyperplonk_{proof,vk}_bytes
fuzz_halo2_{proof,vk}_bytes
fuzz_nova_{proof,vk}_bytes
fuzz_stark_{proof,vk}_bytes
Run any harness with:
cargo +nightly fuzz run --fuzz-dir crates/mosaic-fuzz \
fuzz_<system>_<surface>_bytes -- -max_total_time=300
The remaining audit-pre-req fuzz gaps are:
- Per-system public-input fuzzers (Phase-2 + Phase-3) — the
groth16 one already exists; the others would be near-trivial
follow-ups.
- A combined "all three slots" fuzzer that splits the libfuzzer
input into vk/proof/public_inputs by length-prefix — explores
the cross-slot interaction surface that single-slot fuzzers
can't reach.
Local sanity: `cargo check -p mosaic-fuzz --lib` is clean (only
pedantic missing-docs warnings on the fixture struct fields,
inherited from session 54).1 parent 9a4f04c commit 32dbe90
6 files changed
Lines changed: 144 additions & 0 deletions
File tree
- crates/mosaic-fuzz
- fuzz_targets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
85 | 119 | | |
86 | 120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments