Expand description
Code-join wrap-key derivation.
A single-use join code lets an owner hand a room’s Megolm session key to a
read-only joiner without the passphrase: the joiner sends an ephemeral
X25519 public key, the owner ECDHs against it and wraps the session key under
an HKDF-derived key, and the joiner derives the same key to unwrap. Both
sides compute the identical wrap key from derive_wrap_key; previously
this ECDH+HKDF was open-coded twice in AppHandle (the CodeJoinRequest and
CodeJoinResponse handlers), so it lives here as one tested function.
Functions§
- derive_
wrap_ key - Derive the 32-byte wrap key both sides compute:
HKDF-SHA256over the raw X25519 ECDH shared secret ofour_secretandtheir_pub. The owner uses it topassphrase::wrapthe session key; the joiner uses it tounwrap.