hydrogen-web/src/matrix/e2ee
RMidhunSuresh c0e29fe21b Add return type 2023-06-13 13:26:39 +05:30
..
megolm fix ts errors with latest tsc 4.x version (as used on CI) 2023-03-28 18:14:09 +02:00
olm return enum explaining user trust level rather than boolean 2023-03-07 10:53:32 +01:00
Account.js implement signing users and other devices 2023-03-02 15:02:42 +01:00
DecryptionResult.ts Check verification for response as well 2023-06-08 21:01:11 +05:30
Dehydration.js Fix imports 2021-12-03 11:36:49 +05:30
DeviceTracker.ts Add return type 2023-06-13 13:26:39 +05:30
OlmWorker.js provide random value for IE11 2020-11-10 18:31:18 +01:00
README.md fetch and verify keys on olm call signalling message 2022-06-01 15:29:24 +02:00
RoomEncryption.js Use new prop names 2023-04-11 11:18:35 +05:30
attachment.js move base64/58 encoding into platform 2021-02-12 16:01:54 +01:00
common.ts return enum explaining user trust level rather than boolean 2023-03-07 10:53:32 +01:00

README.md

Integratation within the sync lifetime cycle

session.prepareSync

Decrypt any device messages, and turn them into RoomKey instances. Any rooms that are not in the sync response but for which we receive keys will be included in the rooms to sync.

Runs before any room.prepareSync, so the new room keys can be passed to each room prepareSync to use in decryption.

room.prepareSync

The session can start its own read/write transactions here, rooms only read from a shared transaction

- rooms (with shared read txn)
    - megolm decryption read using any new keys decrypted by the session.

room.afterPrepareSync

- rooms    
    - megolm async decryption   
        - dispatch to worker

room.writeSync

- rooms (with shared readwrite txn)
    - megolm decryption write, yielding decrypted events
    - use decrypted events to write room summary

session.writeSync

  • writes any room keys that were received

room.afterSync

- rooms
    - emit changes

room.afterSyncCompleted

- session
    - e2ee account
        - generate more otks if needed
        - upload new otks if needed or device keys if not uploaded before
    - device message handler:
        - fetch keys we don't know about yet for (call) to_device messages identity
        - pass signalling messages to call handler
- rooms
    - share new room keys if needed