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

all: use OsRng instead of thread_rng() #861

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

conradoplg
Copy link
Contributor

While our libraries don't do RNG directly and take an CryptoRng from the caller, we do have a bunch of tests and examples that do RNG and that people will inevitably copy.

Reading rands CHANGELOG while reviewing #853, I noticed that it has a new "rand is not a crypto library" policy. Its thread_rng that we were using is also not fork-safe. Looking for alternatives I saw that librustzcash uses OsRng, which seems to be the right thing to do (even if it's still in rand, but it's basically a getrandom() wrapper that implements CryptoRng, which is exactly what we need).

This changes all usages of thread_rng() to use OsRng instead.

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.

1 participant