wrap-cli icon indicating copy to clipboard operation
wrap-cli copied to clipboard

getRandomValues Support

Open dOrgJelli opened this issue 3 years ago • 4 comments

Currently wrappers cannot access the system's getRandomValues interface. We should build a plugin to support this. More research & design is needed.

Relevant links: https://docs.rs/getrandom/latest/getrandom/index.html https://docs.rs/getrandom/latest/getrandom/macro.register_custom_getrandom.html https://www.assemblyscript.org/stdlib/math.html#variants https://www.assemblyscript.org/concepts.html#special-imports https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues

dOrgJelli avatar Jun 07 '22 23:06 dOrgJelli

I think this issue is the same as #891 but in rust + as? Hence, we can close the previous one?

cbrzn avatar Jun 09 '22 11:06 cbrzn

Ah good catch, didn't realize @Niraj-Kamdar had already created this. Will close the other one.

dOrgJelli avatar Jun 09 '22 17:06 dOrgJelli

There is currently a WASI proposal for this functionality here: https://github.com/WebAssembly/wasi-random

Before it is released, we could expose via a plugin.

dOrgJelli avatar Sep 20 '22 16:09 dOrgJelli

Please see closing remarks here: https://github.com/polywrap/toolchain/pull/1261#issuecomment-1252779931

We can create a Rust wrapper that uses WASI to facilitate this.

dOrgJelli avatar Sep 20 '22 18:09 dOrgJelli