diff --git a/voice.py b/voice.py index bdef964..97736cd 100644 --- a/voice.py +++ b/voice.py @@ -261,7 +261,10 @@ def _build_e2ee_options() -> rtc.E2EEOptions: key_ring_size=256, key_derivation_function=KDF_HKDF, # Rust FFI applies HKDF; we pass raw base keys ) - return rtc.E2EEOptions(key_provider_options=key_opts) + return rtc.E2EEOptions( + encryption_type=rtc.EncryptionType.GCM, + key_provider_options=key_opts, + ) class VoiceSession: @@ -421,18 +424,9 @@ class VoiceSession: # E2EE: re-enabled after diagnostic confirmed EC encrypts audio. # Root cause found: set_key() only applies HKDF if the frame cryptor for that # participant already exists. Must call set_key() in on_track_subscribed, not at connect time. - key_opts = rtc.KeyProviderOptions( - shared_key=b"", # per-participant mode - ratchet_window_size=16, - ratchet_salt=b"LKFrameEncryptionKey", - failure_tolerance=-1, - key_ring_size=16, - key_derivation_function=KDF_HKDF, # Rust applies HKDF matching EC JS SDK - ) - e2ee_opts = rtc.E2EEOptions( - encryption_type=rtc.EncryptionType.GCM, - key_provider_options=key_opts, - ) + # Parameters MUST match Element Call JS SDK: ratchetWindowSize=10, keyringSize=256, + # failureTolerance=10, ratchetSalt="LKFrameEncryptionKey". + e2ee_opts = _build_e2ee_options() room_opts = rtc.RoomOptions(e2ee=e2ee_opts) self.lk_room = rtc.Room()