Skip to main content

keys_from_exported

Function keys_from_exported 

Source
pub fn keys_from_exported(
    exported: &[u8],
    profile: Profile,
    role: Role,
) -> Result<Keys, KeyError>
Expand description

Split exported keying material into the two SRTP contexts (RFC 5764 §4.2).

§4.2 fixes both the length and the order: 2 * (key + salt) octets, assigned as client write key, server write key, client write salt, server write salt. Keys first and salts after, not key-and-salt per side — which is the natural way to read it and produces a context that authenticates nothing.

role selects which pair protects and which unprotects. Both sides derive the same block; the only thing that differs is which half each one sends with.