Added a randomnumber generator function for WASI to support WebAssembly PQ crypto #405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As a part of a project I am working on there is a heavy use of quantum resistant crypto.
Now that I am porting the library (https://github.com/john-sharratt/ate) over to WebAssembly so that it can run in a web browser I need the same crypto functions to work in wasm32 under wasi however there are no known libraries in rust that support such routines other than pqcrypto - hence I started porting it....
Thus, given that pqcrypto did not yet work on wasi I forked it to add support for compiling to target=wasm32-wasi (https://github.com/john-sharratt/pqcrypto-wasi) - most of it compiles except for the random generator which is runtime specific thus I have added a function within WASI.
The pull request over at pqcrypto is here:
rustpq/pqcrypto#22
The new function only impacts builds that target wasi hence it is fully forwards and backwards compatible.
To compile you need to use target wasm32-wasi and must have wasi-libc - take a look at this repo for an example on how to compile it:
https://github.com/john-sharratt/pqcrypto-wasi