Repository navigation
Conversation
…nknown_js, and wasm32_unknown_unknown_custom_or_js.
|
I have researched this further. With the WASI 0.2 component model, there's not much reason for wasm32-unknown-unknown to exist any longer. In any environment that currently uses wasm32-unknown-unknown, a minimal WASI 0.2 environment that implements just the Consequently, I think we shouldn't bother trying to do more than we're currently doing. |
|
Thanks for researching into this! However, I have to point out that WASI is not the only game in town, and there are plenty use cases where randomness is supplied through other means, or no randomness is required at all (e.g. when ring is only used for verification purpose). Anyway, the problem with cargo features is that once a feature is brought in, there is no way to avoid it. And PS: I work on Internet Computer that has deployed close to a million wasm programs/services onto the internet. Not an insignificant use case, I'd say. And these wasm programs do not run with WASI. Besides, if they need randomness, it has to be supplied asynchronously, so a synchronous interface (like the one in WASI) does not cut it. I hope I've made a valid case here. Thank you for the consideration! |
|
If you look at the design of |
ring also expects a synchronous randomness API with its current design. I'm not sure how we'd support an async API. |
|
Not sure if I understood all the nuances of how getrandom works in wasm32-unknown-unknown, but isn't the custom feature delegating the randomness provision to the user, so that libraries using getrandom does not have to worry about them? The documentation of getrandom also says the following about the
|
|
Thanks for the PR. I appreciate the effort here. I am not accepting PRs for this project any longer. |
Instead of just having one
wasm32_unknown_unknown_jsfeature that imposesgetrandom/jsupon ring's users, two additional features are added to provide more flexibility.wasm32_unknown_unknown_custom_or_jsimplementsSecureRandomforSystemRandom, but does not make a choice betweengetrandom/jsorgetrandom/custom. It instead delegates the choice to the library's user.wasm32_unknown_unknown_jsenables bothwasm32_unknown_unknown_custom_or_jsandgetrandom/js.wasm32_unknown_unknown_customenables bothwasm32_unknown_unknown_custom_or_jsandgetrandom/custom.This change is only relevant for the
wasm32-unknown-unknowntarget.