Skip to main content

derive_kek

Function derive_kek 

Source
pub fn derive_kek(
    passphrase: &[u8],
    salt: &[u8; 16],
    klen: usize,
) -> Result<Vec<u8>>
Available on crate feature crypto only.
Expand description

Derive the Key Encrypting Key (KEK) from the pre-shared passphrase (draft-sharabayko-srt-01 §6.1.4, §6.2.1 sender / §6.3.1 receiver — identical formula both sides):

KEK = PBKDF2(passphrase, LSB(64,Salt), Iter=2048, KLen)

salt is the Key Material message’s 128-bit Salt field; klen is the desired KEK length in bytes (16/24/32, matching the handshake’s Encryption Field / the Key Material message’s KLen/4 — “the KEK has to be at least as long as the SEK”, §6.1.4).

§Errors

Error::InvalidField if klen is not 16, 24, or 32.