Skip to content
Snippets Groups Projects
Unverified Commit f61b60e2 authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #640

640: Reimplement random data generation, add `read_entropy` syscall r=stlankes a=joboet

Fixes #143 by reimplementing random data generation using a [ChaCha-based RNG](https://docs.rs/rand_chacha/0.3.1/rand_chacha/struct.ChaCha20Rng.html) continuously reseeded using the `RDSEED` instruction. This should provide better security, as `RDRAND` is known to have hardware bugs. 

Also adds a new buffer-based syscall, `read_entropy`, which better fits the usecase of crates like [`getrandom`](https://github.com/rust-random/getrandom

).

The old `secure_rand*` and `rand` syscalls should probably be removed at some point, but I do not know the Hermit stability policy and therefore have not done this in this PR.

Co-authored-by: default avatarjoboet <jonasboettiger@icloud.com>
parents 7add968a 58860a98
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment