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

provide new generators: urandom and getentropy #250

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

Conversation

hannesm
Copy link
Member

@hannesm hannesm commented Nov 27, 2024

to fix #249

@hannesm
Copy link
Member Author

hannesm commented Nov 27, 2024

There's the question how to annotate Fortuna to be racy. Should there be an [@@alert]?

Provide guidance to use these by default, document that Fortuna is not
thread-safe. As suggested in mirage#249
rng/mirage_crypto_rng.mli Outdated Show resolved Hide resolved
rng/unix/getentropy.ml Show resolved Hide resolved
rng/unix/mirage_crypto_rng_unix.ml Show resolved Hide resolved
rng/unix/mirage_crypto_rng_unix.mli Show resolved Hide resolved
rng/unix/urandom.ml Show resolved Hide resolved
hannesm and others added 2 commits November 29, 2024 21:09
@hannesm
Copy link
Member Author

hannesm commented Nov 29, 2024

The failure semantics is now a bit sad: if for some reason the fd that has /dev/urandom open isn't able to read, we'll end up in an exception. previously with fortuna we were sure that once it is seeded, we'll never fail...

but i guess if /dev/urandom doesn't deliver anymore we have other problems, and it's fine to raise an exception.

since the pfortuna benchmark has been moved to bench/speed, remove bench/miou

Mirage_crypto_rng_unix: remove getrandom_into
@hannesm
Copy link
Member Author

hannesm commented Dec 6, 2024

I think this is fine to merge now.

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.

mirage-crypto-rng.unix thread safety?
3 participants