Skip to main content

Module fragment

Module fragment 

Source
Expand description

PQ handshake fragmentation with admission before buffering.

Bytes are charged against a per-message cap first. Only then may a fragment be copied into the bounded reassembly slot. Truncated wire is QdnfError::Truncated and does not copy. Interface loss is QdnfError::Closed; reconnect bumps generation so old tickets are useless.

Structs§

AdmitTicket
Proof that charged bytes were admitted for msg_id at generation.
FragmentHeader
HandshakeReassembler

Constants§

FRAG_HDR_LEN
msg_id(4) || offset(2) || total(2) || frag_len(2).
MAX_FRAGMENTS
MAX_FRAME
MAX_HANDSHAKE_BYTES
Hybrid handshake (ML-KEM-768 + X25519 + signatures) fits under this cap.
MAX_SESSIONS

Functions§

admit_and_buffer
Decode, admit, then copy. Truncated or oversize wire never copies.
decode_fragment
Decodes a fragment header, returning it with the payload slice.
encode_fragment
Encodes a fragment header + payload into the frame.
fragment_payload_mtu
Payload bytes available per fragment under mtu.
split_handshake
Split a PQ handshake into bounded frames. payload_mtu is bytes after the fragment header (use fragment_payload_mtu).