Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zphrs Random #12

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

zphrs
Copy link

@zphrs zphrs commented Jul 19, 2024

Adds the random RFC.


[guide-level-explanation]: #guide-level-explanation

The module should expose a `getrandom(dest: &mut [u8])` function (and syscall) which will entirely fill the `dest` buffer with bytes. It might block while doing so during the initial seeding of the CSPRNG. I also propose providing a `getrandom_nonblocking(dest: &mut [u8]) -> usize` which will do the same but without blocking, returning the number of bytes overwritten into `dest` (which can be 0).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest we do getrandom(dest: &mut [u8], flags: GetRandomFlags), where flags would be defined using the bitflags crate. For now, we'd only have one, "NONBLOCKING". Allows future additions if we reserve all other flags for future expansion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants