Skip to main content

Module budget

Module budget 

Source
Expand description

Profile overhead budgets. Charge each component separately (Recipe F).

Padding, relay copies, handshakes, cover traffic, retries, storage and cryptographic work are never lumped into a single opaque total before the checked add in OverheadBudget::total_bytes.

Structs§

OverheadBudget
Per-component overhead. Fields are independent charges.

Constants§

P1_PADDING_BUCKET
P1 pads application size up to the next 256-byte bucket.
P2_RECORD_BYTES
P2 default application record size (last-record padding uses this bucket).
P3_CELL_BYTES
P3/P4 traffic-cell target. A 4 KiB record is not an MTU claim.
P3_COVER_BYTES_PER_SEC
P3 initial optional cover budget: 4 KiB/s per direction.
P3_RELAY_HOPS
P3 approved-relay hop count when relays are selected (not isolated bearer).

Functions§

crypto_work_units
Crypto work units: 1 << profile_rank (P0=1, P1=2, P2=4, P3=8, P4=16).
estimate_overhead
OverheadBudget::estimate_overhead.
handshake_bytes_hybrid
Hybrid handshake byte count: initiator (ML-KEM-768 pk + X25519 pk) + responder (ML-KEM-768 ct + X25519 pk)
pad_to_next_bucket
Round size up to the next multiple of bucket.
record_bucket
Records bucket.