Skip to main content

Module data

Module data 

Source
Expand description

Optional data encryption, negotiated independently on each relay leg. The authenticated setup response selects a format before application I/O.

                 one shared key K per relay leg
Endpoint  ---- nonce = 00000000 | counter:u64be ----> Relay
Endpoint  <--- nonce = 00000001 | counter:u64be ----- Relay
                       4 bytes       8 bytes

Setup:    install K and a fixed prefix; no data-key derivation or extra RTT.
Per frame: increment the local counter, then one AES-GCM operation.
Wire:     checksum:u32 | length:u32 | ciphertext | tag[16] (unchanged).

Counters start at zero independently. Prefixes keep their nonce spaces disjoint under K. The other relay leg has its own fresh key and counters.

Structs§

DataCodec
Negotiated key material for exactly one endpoint-to-relay connection. Debug output intentionally never includes the secret.

Constants§

DATA_PROTOCOL_V2
Version with disjoint directional nonce prefixes and checked 64-bit counters.