fuzz: pass the 4th bootstrap arg (hybrid ML-KEM peer key) #201

Merged
sirius merged 2 commits from wt/t_a866e490 into main 2026-10-31 03:29:05 +00:00
Owner

Summary

  • RatchetState::bootstrap gained remote_kem_pub: Option<&[u8]> in b22abd7 (PR #185). The fuzz target still called it with 3 args, so cargo +nightly fuzz build has failed every night since 2026-10-20 (nightly runs 828, 817, 806, 800, 798, 790, 774).
  • The target now bootstraps both shapes: None for a classical friend, and Some(pk) for a hybrid friend, where pk is a real ML-KEM-768 encapsulation key of onionwire::kem::PK_LEN (1184) bytes derived once from a fixed 64-byte seed via kem::pk_from_seed. No length is hardcoded; the length is asserted against kem::PK_LEN.
  • Invariants unchanged: arbitrary input never panics, a parsed state re-serializes, and a rejected frame rolls back to the exact pre-decrypt bytes (to_bytes() == before).

Scope

Only fuzz/ changes. git diff --stat -- src crates tests Cargo.toml Cargo.lock is empty.

Verification (local)

  • cargo +nightly fuzz build — all four bins build clean (5m11s cold).
  • FUZZ_SECS=15 FUZZ_JOBS=2 bash scripts/run-fuzz.sh — all four targets survived, oom/timeout/crash: 0/0/0.
  • cargo +nightly fuzz run ratchet_frame -- -runs=200 — 200 runs, exit 0, no crash.

A green fuzz dispatch on merged main follows.

## Summary - `RatchetState::bootstrap` gained `remote_kem_pub: Option<&[u8]>` in b22abd7 (PR #185). The fuzz target still called it with 3 args, so `cargo +nightly fuzz build` has failed every night since 2026-10-20 (nightly runs 828, 817, 806, 800, 798, 790, 774). - The target now bootstraps **both** shapes: `None` for a classical friend, and `Some(pk)` for a hybrid friend, where `pk` is a real ML-KEM-768 encapsulation key of `onionwire::kem::PK_LEN` (1184) bytes derived once from a fixed 64-byte seed via `kem::pk_from_seed`. No length is hardcoded; the length is asserted against `kem::PK_LEN`. - Invariants unchanged: arbitrary input never panics, a parsed state re-serializes, and a rejected frame rolls back to the exact pre-decrypt bytes (`to_bytes() == before`). ## Scope Only `fuzz/` changes. `git diff --stat -- src crates tests Cargo.toml Cargo.lock` is empty. ## Verification (local) - `cargo +nightly fuzz build` — all four bins build clean (5m11s cold). - `FUZZ_SECS=15 FUZZ_JOBS=2 bash scripts/run-fuzz.sh` — all four targets survived, `oom/timeout/crash: 0/0/0`. - `cargo +nightly fuzz run ratchet_frame -- -runs=200` — 200 runs, exit 0, no crash. A green `fuzz` dispatch on merged `main` follows.
RatchetState::bootstrap gained remote_kem_pub in b22abd7 (PR #185), so the
fuzz target has not compiled since 2026-10-20 and the nightly fuzz job has
been red for ten days.

Pass None for the classical shape and a real ML-KEM-768 encapsulation key
(crate::kem::PK_LEN bytes, built once from a fixed 64-byte seed) for the
hybrid shape, so both bootstrap paths are fuzzed. The invariants are
unchanged: arbitrary bytes never panic, a parsed state re-serializes, and a
rejected frame rolls back to the exact pre-decrypt state.
sirius merged commit b5f3829c23 into main 2026-10-31 03:29:05 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!201
No description provided.