Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Special considerations for wasm32 #1921

Open
briansmith opened this issue Jan 16, 2024 · 0 comments
Open

Documentation: Special considerations for wasm32 #1921

briansmith opened this issue Jan 16, 2024 · 0 comments

Comments

@briansmith
Copy link
Owner

We should document:

  • wasm32 is supported.
  • wasm32 is especially difficult to deal with w.r.t. timing side channel protections, as this is controlled by the wasm32 compiler and runtime.
  • wasm32-wasi is supported without any feature flags.
  • wasm32-unknown-unknown is supported if ring's wasm32_unknown_unknown_js feature is enabled, in which case Crypto.getRandomValues() will be used. We are open to accepting PRs to add to similar feature flags for other wasm32-unknown-unknown environments.

Libraries that want to work similarly should consider providing a similar feature flag to the library that triggers the wasm32_unknown_unknown_js feature, like this:

#[features]
wasm32_unknown_unknown_js = ["ring/wasm32_unknown_unknown_js"];

Alternatively, the application can always ask for the feature to be enabled itself, even if it doesn't otherwise directly use ring:

[dependencies]
ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant