Open kegsay opened 4 months ago
I think that this is mostly due to our PBKDF usage in the default case when we encrypt the store. The usage of a random key is possible with our primitive itself:
But it's not easily exposed in the ClientBuilder
like the passphrase based mechanism is:
We would need a new method to let us create stores with a random key instead.
As seen in https://github.com/matrix-org/complement-crypto/pull/122 which times out due to how slow it gets with encryption enabled via
.Passphrase
being set on theclient_builder
.Example timings:
TestAliceBobEncryptionWorks/{rust_hs1}|{rust_hs1}
- this creates 2 clients, 1 room and Alice sends 1 message to Bob. It's the simplest E2EE test. 910ms without encrypted DB, 4.86s with.TestFallbackKeyIsUsedIfOneTimeKeysRunOut
- this consumes all OTKs (blocking the client uploading more) then claims the fallback key, so it will cause the client to re-upload 50 OTKs. 2.52s without, 8.43s with.This is 3-5x worse.
This means I can't realistically enable encrypted DBs in tests, which is desirable in order to match EX.