Skip to main content

derive_session_key

Function derive_session_key 

Source
pub fn derive_session_key(root_secret: &[u8], session_id: &str) -> [u8; 32]
Expand description

§10.2: Derive a session-specific symmetric key from a root secret. Used to derive ephemeral keys for specific message streams (e.g. per agent-pair, per task-id) without re-running the full ECDH handshake for every message (reduces CPU overhead and exposure). root_secret must be the 32-byte ECDH shared secret. session_id is an opaque string distinguishing the channel (e.g. “agent-a-to-b-task-123”).