Requesting Feedback: WIP changes to rand.rs
#846
Closed
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.
This PR is a collection of all the potential improvements to
rand.rs
. This won't be merged as-is, and will need to be split off into smaller PRs like #839. Not all of the ideas here will end up being merged. I'm just putting this up to get feedback from @briansmith @sconybeare @myfreeweb @oherrala @tatsuya6502 and anyone else who interested.This was motivated by the work I've been doing for the
getrandom
crate.Things this patch does:
sysrand
: get randomness via a syscall or system functionfile
: get randomness from a filesysrand
andfile
/dev/random
before reading from/dev/urandom
dev_urandom_fallback
feature, as it is no longer needed for security. If you want to force Linux to usegetrandom
just don't enable theuse_heap
feature.libc::SYS_getrandom
(Use libc::SYS_getrandom #839)GRND_NONBLOCK
forgetrandom()
detectionerror::Unspecified
to make error handling easier.