Skip to main content

select_sek

Function select_sek 

Source
pub fn select_sek<'a>(
    key_flag: EncryptionKeyField,
    even: Option<&'a [u8]>,
    odd: Option<&'a [u8]>,
) -> Result<&'a [u8]>
Available on crate feature crypto only.
Expand description

Select the SEK to use for a data packet from its KK field (draft-sharabayko-srt-01 §3.1/§6.1.6): even/odd are the two SEKs currently held (both may be live during the ±KM-Pre-Announcement-Period` rekey transition window, §6.1.6).

§Errors

Error::InvalidField if the packet is unencrypted (KK = NotEncrypted) or carries the control-packet-only reserved value, or if the selected parity’s SEK is not currently held (e.g. not yet unwrapped, or already decommissioned — §6.3, step 11: such packets “must be dropped”).