feat(store-key): Add a feature flag to enable WASM support

This commit is contained in:
Damir Jelić
2022-03-15 12:37:27 +01:00
parent 11d27007fc
commit 5766b65eeb
2 changed files with 13 additions and 0 deletions

View File

@@ -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"

View File

@@ -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).