Skip to main content

ratchet_stream_key

Function ratchet_stream_key 

Source
pub fn ratchet_stream_key(current: &[u8; 32]) -> Zeroizing<[u8; 32]>
Expand description

One-way epoch ratchet for long-lived streams (S3 #554 / #223).

Derive the next epoch’s key from the current one via a one-way KDF: a compromise of the current epoch key cannot recover any earlier epoch (forward secrecy across rekeys). Bump epoch, ratchet the key, reset seq — keeping the (epoch, seq) AEAD nonce (see crypto::cose_encrypt) unique-forever.