mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 05:30:33 -04:00
feat(store-key): Add a feature flag to enable WASM support
This commit is contained in:
@@ -6,10 +6,14 @@ description = "Helpers for encrypted storage keys for the Matrix SDK"
|
||||
repository = "https://github.com/matrix-org/matrix-rust-sdk"
|
||||
license = "Apache-2.0"
|
||||
|
||||
[features]
|
||||
js = ["getrandom/js"]
|
||||
|
||||
[dependencies]
|
||||
blake3 = "1.3.1"
|
||||
chacha20poly1305 = { version = "0.9.0", features = ["std"] }
|
||||
displaydoc = "0.2"
|
||||
getrandom = { version = "0.2.5", optional = true }
|
||||
hmac = "0.12.1"
|
||||
pbkdf2 = "0.10.1"
|
||||
rand = "0.8.4"
|
||||
|
||||
@@ -70,3 +70,12 @@ used for non-Matrix specific data users need to ensure:
|
||||
1. That individual values are chunked, otherwise decryption might be succeptible
|
||||
to a DOS attack.
|
||||
2. The `StoreKey` is periodically rotated/rekeyed.
|
||||
|
||||
# WASM support
|
||||
|
||||
This crate relies on the `random` and `getrandom` crates which don't support
|
||||
WASM automatically.
|
||||
|
||||
Either turn the `js` feature on directly on this crate or depend on `getrandom`
|
||||
with the `js` feature turned on. More info can be found in the [`getrandom`
|
||||
docs](https://docs.rs/getrandom/latest/getrandom/index.html#webassembly-support).
|
||||
|
||||
Reference in New Issue
Block a user