You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So with v 0.9.0 for rand and rand_core, will get a error like 'error[E0277]: the trait bound ThreadRng: CryptoRngCore is not satisfied".
Reacted by thexeondev, Rahul Iyengar, Trevypants, Darren Bolduc, Nihaal Sangha, dunklas, Alexander Medvedev, Vadim Anufriev, Ophir LOJKINE, Lasne Olivier and 5 more
Reacted by Alexander Medvedev and Luca Cappelletti
@c410-f3r the nice thing about CryptoRng is it provides a type-safe interface for ensuring the supplied RNG is actually safe to use for cryptography. A "just make some bytes" API like that can be easily misused with RNGs which are unsuitable for cryptographic use.
In the next set of releases of the https://github.com/rustcrypto/traits crates, we're also providing (and pushing people towards) a non-parameterized random generation APIs which avoids compatibility problems between crate versions and explicit RNGs: RustCrypto/traits#1371
Activity
c410-f3r commentedon Feb 11, 2025
With the possible addition of rust-lang/rust#130703 it would be nice to avoid hard-coding
randin public interfaces.For example, some functions could provide a callback where the user is responsible for providing entropy.
Its-Just-Nans commentedon Feb 11, 2025
Related to RustCrypto/traits#1642
tarcieri commentedon Feb 11, 2025
@c410-f3r the nice thing about
CryptoRngis it provides a type-safe interface for ensuring the supplied RNG is actually safe to use for cryptography. A "just make some bytes" API like that can be easily misused with RNGs which are unsuitable for cryptographic use.In the next set of releases of the https://github.com/rustcrypto/traits crates, we're also providing (and pushing people towards) a non-parameterized random generation APIs which avoids compatibility problems between crate versions and explicit RNGs: RustCrypto/traits#1371
[-]CryptoRngCore was removed from the latest version of rand_core[/-][+]`rand_core` v0.9 support[/+]