08. Secure Transport
Rust protocol, AEAD, replay, rotation, and loopback QUIC testsThe protocol uses a fixed 78-byte header with magic, version, frame kind, request/stream IDs, sequence, dtype, shape, and payload length. Decoders reject truncation, overflow, invalid types, and trailing bytes. Fuzz inputs do not panic.
AEAD lifecycle
HKDF-SHA256 derives distinct send/receive keys. Nonces encode monotonic sequence numbers. A 64-packet replay window permits recent reordering but rejects duplicates and old packets. Authentication completes before replay state changes. Epoch rotation replaces keys and starts a new nonce domain; exhaustion fails closed.
Fortress role sessions are opened with one fixed-size round trip. The client sends a fresh ephemeral key and a secret sealed to the worker’s static key; the worker returns a secret sealed to that ephemeral key, the digest of the artifacts it loaded, and a signature from its identity key. Both seals are RFC 9180 HPKE with the combined ML-KEM-768/X25519 KEM, and the session keys come from both secrets, so the worker’s static key alone does not open a recorded session. Keys then move through a one-way ratchet at every rotation. On a direct route the handshake is bound to the TLS connection by a TLS exporter value; through relays it is not, and a task trace reports which case applied. A ProVerif model of this exchange over a public channel is checked into the repository with a CI job that runs it; it covers direct routes. A second model covers relayed routes, where the worker cannot identify the client, and the key ratchet. That hosted job has not run, so the recorded results come from manual runs.
The older interactive stage and protected-media sessions, which Fortress role workers do not use, establish a fresh random master using RFC 9180 HPKE with the combined ML-KEM-768/X25519 KEM and ChaCha20-Poly1305, bound to session identifiers and authentication tokens. They are not forward-secret. HPKE Base mode alone does not authenticate the client; mutual TLS supplies peer authentication. The ProVerif model represents authenticated establishment as a private channel and its checker script rejects false or missing query results. The older raw-X25519 session exchange has been removed. Mutual rustls QUIC additionally negotiates X25519MLKEM768 in the transport test, so the data plane has independent forward-secret hybrid post-quantum TLS key exchange. Signatures combine Ed25519 with ML-DSA-65. Shard key sealing uses the same hybrid suite. TLS certificates are classical.
Onion-style layers use ephemeral ECDH keys in the browser simulation; in production each layer is sealed to one hop with X25519 and ML-KEM-768 together and names only that hop’s next address. Allowlisted oblivious relays forward frames without receiving session keys; destination workers unwrap their own layer. The relay sees the client address, workers see the relay address, and a global adversary can still correlate traffic.
Each remote model shares one QUIC connection and encrypted session per role, rather than allocating connections, threads, and sessions per linear operation. Operation names remain authenticated inside payloads, key rotation uses the same per-role schedule on client and worker, and the grid runtime owns session teardown. Fresh operation seeds derive per-row and per-role activation seeds; non-final roles receive 32-byte seeds while the final role receives its residual share. This reduces large-payload chunking but provides computational rather than information-theoretic hiding. Raw shares remain available with seeded_activations=false. Fortress frames carry random padding to a configured fixed size, while verified grid-rate cover calls round-robin operations through the same exact-product and Freivalds path as real calls. Privacy-safe metrics expose reconnections and cover failures without request contents. The local timing-classifier result is reported with its sample counts and limitations in docs/evidence/fortress/transport.json; it is not a general Whisper-Leak defense proof.
PyO3 exposes bidirectional clients, servers, and worker connections with GIL release and explicit close/abort lifecycle. Native and Fortress tests prove wrong-identity rejection, timeout abort, authenticated cancellation, per-epoch key rotation, and graceful shutdown. NAT behavior and WAN performance remain unmeasured.
Provider NAT fallback
When direct UDP forwarding fails, the optional datagram_tunnel mode forwards length-bounded datagrams through SSH local port forwarding. Loopback TCP/UDP relays track and clean up their processes; managed setup defaults to two concurrent starts, configurable through startup_concurrency, to avoid gateway process bursts. QUIC mutual authentication and payload encryption remain end-to-end. A local relay test carries a real mutual-TLS QUIC round trip. Physical direct-UDP attempts timed out, and a relayed grid run failed during cover traffic after partial model execution. Neither result is represented as a completed independent-host inference gate or a performance benchmark.