Skip to main content

derive_dm_key

Function derive_dm_key 

Source
pub fn derive_dm_key(
    our_ed25519_seed: &[u8; 32],
    partner_ed25519_pubkey: &[u8; 32],
    canonical_room_id: &str,
) -> Result<[u8; 32]>
Expand description

Derive the symmetric DM room key from one side’s Ed25519 secret seed and the other side’s Ed25519 public key, plus the canonical DM room_id (which binds the key to this specific 1-1 channel).

Both peers, swapping seed ↔ pubkey, derive identical output. This is the classical (pre-quantum) derivation, kept as the backward-compatible fallback when a peer has not published an ML-KEM key. See derive_dm_key_hybrid_initiator / _responder for the post-quantum path.