Skip to main content

Module key_material

Module key_material 

Source
Expand description

Key Material message — draft-sharabayko-srt-01 §3.2.2, Figures 10-11.

Carried either as a Handshake Extension (§3.2.1.2, Extension Type SRT_CMD_KMREQ/SRT_CMD_KMRSP) or as the CIF of a User-Defined control packet (Subtype SRT_CMD_KMREQ/SRT_CMD_KMRSP, §3.2.2).

word0   S(1) V(3) PT(4) | Sign(16) | Resv1(6) KK(2)
word1   KEKI(32)
word2   Cipher(8) Auth(8) SE(8) Resv2(8)
word3   Resv3(16) SLen/4(8) KLen/4(8)
..      Salt (SLen bytes)
..      ICV (8 bytes) | xSEK (KLen bytes) | [oSEK (KLen bytes)]

S, V, PT, Sign, Resv1, Resv2, Resv3 are fixed-value fields (the spec gives each a mandated value = {..}); they are validated on parse and not stored (matching the crate’s reserved-bit policy — see the crate root docs), except PT, which acts as this struct’s discriminating magic number (must be 2, “Keying Material Message”).

This module only carries the wrapped-key bytes — it performs no AES key-wrap/unwrap. Actual encryption/decryption is an explicit follow-up (see the crate root docs).

Structs§

KeyMaterial
Key Material message (draft-sharabayko-srt-01 §3.2.2, Figures 10-11).

Enums§

Cipher
Cipher: encryption cipher and mode (draft-sharabayko-srt-01 §3.2.2).
KmAuth
Authentication: message authentication code algorithm (draft-sharabayko-srt-01 §3.2.2).
KmKeyFlag
KK: which SEK(s) (odd/even) this Key Material message provides (draft-sharabayko-srt-01 §3.2.2).
StreamEncapsulation
SE: stream encapsulation (draft-sharabayko-srt-01 §3.2.2).

Constants§

CIPHER_AES_CTR
AES-CTR.
CIPHER_NONE
Cipher wire values (§3.2.2).
KM_AUTH_NONE
Authentication wire values (§3.2.2).
KM_KK_BOTH
Both keys provided.
KM_KK_EVEN
Even key provided.
KM_KK_NO_SEK
KK wire values of the Key Material message (§3.2.2). Distinct from the data-packet KK field (super::EncryptionKeyField) — same 2-bit shape, different meaning.
KM_KK_ODD
Odd key provided.
STREAM_ENCAP_MPEG_TS_SRT
MPEG-TS/SRT.
STREAM_ENCAP_MPEG_TS_UDP
MPEG-TS/UDP.
STREAM_ENCAP_UNSPECIFIED
SE (Stream Encapsulation) wire values (§3.2.2).