-
Notifications
You must be signed in to change notification settings - Fork 432
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
Move thread RNG into a separate crate #1520
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this? I'm still not convinced.
If we do:
- The
thread-rng
name is not consistent withrand_core
etc. Probably should berand_thread_rng
. - We switched to using explicit features (Use explicit features rather than implicit. #1473)
rand::rng
,rand::random
etc. need their cfg updated
How about |
This PR is mostly ready for review. I will work on docs and readme after it's decided that we will move forward with it.
I do. :) My main motivation is to be able to use and recommend |
You can already. And if you're talking about the disclaimer, it applies to this just as much as it does to |
I can not fully recommend it now because it pulls the whole |
|
@newpavlov you were the only proponent in #716 while several people were against, and I haven't seen any change there. |
Having I guess the actual wording in the changes in #1514 is perhaps not as strong as "rand is not a crypto library":
I would argue a CSRNG is high-level cryptographic functionality. It is not uncommon for cryptography libraries to suggest the use of |
My POV is that #1514 is mostly a disclaimer: |
This was previously discussed in #716 and recently raised in #1514.
The main disadvantage of moving thread RNG into its own crates is that users of
rand
(with default crate features) will have one additional dependency in their dependency tree. On the other hand,ThreadRng
can be now used without the rest ofrand
(e.g. in cryptographic applications). It also results in simpler configuration flags and thread RNG code, since we don't need to deal with the generality ofReseedingRng
.If
ReseedingRng
is not used in practice (cursory search on GitHub shows mostly vendoredrand
code), we probably can remove it completely or move into a separate crate.