Expand description
Voice media encryption (ADR-0018): an end-to-end layer over WebRTC whose keys come only from post-quantum or hybrid primitives, authenticated by the members’ composite keys.
member key (ML-DSA-65 + Ed25519) ──signs──▶ KeyPackage { X-Wing public key, voice session }
──signs──▶ SenderKeys { epoch, KID, H(wrapped) per recipient }
sender base key (32 random bytes, one per epoch)
──HPKE base mode (X-Wing, HKDF-SHA256, AES-256-GCM)──▶ WrappedKey, one per recipient
──SFrame (RFC 9605, AES_256_GCM_SHA512_128)──────────▶ sealed framesEverything here is sans-IO. The host relays key packages, sender keys and wrapped keys as opaque bytes; it cannot read frames or substitute keys without breaking a member signature. The trust root is the roster’s member public keys, which the host serves.
Structs§
- Frame
Opener - Opens one sender’s frames for one KID, rejecting replays.
- Frame
Sealer - Seals this participant’s frames under one base key and KID. The counter starts at zero and
never repeats; after
FRAMES_PER_KEYframes it refuses and the sender rekeys. - Group
Keys - A participant’s key state for one voice session.
- Header
- An SFrame header (RFC 9605 §4.3).
- KeyPackage
- A participant’s voice key for one session in one voice channel.
- Package
Expectation - What a receiver expects of a peer’s key package.
- Recipient
Entry - One recipient of a sender’s epoch key.
- Rekey
- What a rekey sends: one signed sender-keys message for everyone and one wrapped key each.
- Rekey
Target - One recipient’s share of a
Rekey. - Sender
Key - An SFrame base key (32 bytes). Zeroized on drop, never printed, never on the wire unwrapped.
- Sender
Keys - The signed statement of one sender’s epoch (see the module table).
- Sender
Keys Expectation - What a recipient expects of a sender-keys message.
- Signed
KeyPackage - A key package whose signature was made here or verified.
- Signed
Sender Keys - A sender-keys message whose signature was made here or verified.
- Voice
Identity - A voice session’s X-Wing key pair. The secret is the 32-byte X-Wing seed, zeroized on drop and never printed. It lives only as long as the voice session; it is never stored.
- Voice
Public Key - An X-Wing encapsulation key (ML-KEM-768 ‖ X25519, 1 216 bytes), validated on parse.
- Voice
Session Id - One participation in a voice channel. A member draws a fresh one on every join, so KIDs and epochs never repeat across joins.
- Wrap
Context - Who wraps, for which channel and epoch: bound into the HPKE
info. - Wrapped
Key - A base key wrapped to one recipient: X-Wing
enc‖ AES-256-GCM ciphertext ‖ tag.
Enums§
- Voice
Error - A voice key or frame operation failed.
Constants§
- BASE_
KEY_ LEN - An SFrame base key: 32 bytes.
- FRAMES_
PER_ KEY - Frames one base key may seal before the sender must rekey (2^32: far beyond a session’s length at 50 frames a second, and well inside AES-GCM’s limits for distinct nonces).
- HEADER_
MAX - Longest header: config byte, 8-byte KID, 8-byte CTR.
- KEM_
CIPHERTEXT_ LEN - X-Wing ciphertext (HPKE
enc) length. - KEM_
PUBLIC_ LEN - X-Wing encapsulation (public) key length.
- KEY_
PACKAGE_ BYTES_ LEN - Canonical bytes of a key package (all fields are fixed width): 1 306 bytes.
- KEY_
PACKAGE_ WIRE_ LEN - A key package on the wire: canonical bytes ‖ composite signature, 4 680 bytes.
- MAX_
RECIPIENTS - Most recipients one sender-keys message names (a mesh of 32 participants).
- RECIPIENT_
ENTRY_ LEN - One recipient entry: member id ‖ voice session ‖ SHA3-256 of the wrapped key.
- REPLAY_
WINDOW - Counters a receiver accepts behind the highest one seen (out-of-order delivery).
- SENDER_
KEYS_ BYTES_ MAX - Largest canonical sender-keys message: 2 090 bytes.
- SENDER_
KEYS_ FIXED_ LEN - Canonical bytes of a sender-keys message without its recipients.
- SENDER_
KEYS_ WIRE_ MAX - Largest sender-keys message on the wire:
u32length ‖ bytes ‖ signature, 5 468 bytes. - SFRAME_
CIPHER_ SUITE - The SFrame cipher suite:
AES_256_GCM_SHA512_128. - SFRAME_
OVERHEAD_ MAX - Most bytes SFrame adds to a frame: the longest header and the tag.
- SUITE_
V1 - The voice suite of protocol version 1: X-Wing KEM, HPKE (HKDF-SHA256, AES-256-GCM), SFrame
AES_256_GCM_SHA512_128. Unknown suites are rejected (ADR-0011 agility rules). - TAG_LEN
- AES-256-GCM tag length (HPKE and SFrame).
- WRAPPED_
KEY_ LEN - A wrapped sender key:
enc ‖ AES-256-GCM(base key) ‖ tag, 1 168 bytes.
Functions§
- derive_
key_ salt - RFC 9605 §4.4.2
derive_key_saltfor suite0x0005. - kid_for
- The KID of a sender’s epoch: the first 3 bytes of
SHA3-256("zaun/v1/voice-kid" ‖ session)above the 32-bit epoch.