-
Notifications
You must be signed in to change notification settings - Fork 494
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
WIP: Bump to rand[_core] 0.9 #729
base: main
Are you sure you want to change the base?
Conversation
@pinkforest it needs to be |
Since Example for ed25519/src/signing.rs pub fn generate<R: RngCore + CryptoRng + ?Sized>(csprng: &mut R) -> SigningKey {
let mut secret = SecretKey::default();
csprng.fill_bytes(&mut secret);
Self::from_bytes(&secret)
}
pub fn try_generate<R: TryRngCore + TryCryptoRng + ?Sized>(csprng: &mut R) -> Result<SigningKey,<R as TryRngCore>::Error> {
let mut secret = SecretKey::default();
csprng.try_fill_bytes(&mut secret)?;
Ok(Self::from_bytes(&secret))
} It will offer some backward compatibility while aligning with |
https://docs.rs/rand_core/0.9.0/rand_core/trait.CryptoRng.html Also you can call |
I assume we can live with ff/group will get duplicate 0.8 rand until ff/group upgrades - unblocking us to adopt 0.9 ? |
Pending / Clarifications
Breaking/Minor (Opt-in): We need to implementTryCryptoRng
which needs API changes from current infallible API.Notes
rand::thread_rng
: renamed torng
<-- was renamedOsRng
does not seem to implementCryptoRng
? rust-random/rand#1561ThreadRng
andOsRng
implement diffTry/CryptoRng
traits rust-random/rand#1566rand::rng()
useOsRng
unlessthread_rng
is enabled? rust-random/rand#1545