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
In the example that you give of creating keypairs, you use the rand_core Osrng:
use rand_core::OsRng;
use x25519_dalek::{EphemeralSecret, PublicKey};
let alice_secret = EphemeralSecret::new(OsRng);
let alice_public = PublicKey::from(&alice_secret);
After reading a bit up on the osrng, I read that it was not a cryptographically secure source of randomness, and that I should use a resource that specifcally had a focus on that.
The most common option for a csprg, seems to be the StdRng in the rand crate. That I was advised to use.
Is it possible to use use rand::{rngs::StdRng}; to create keypairs in your crate? or is the use of osrng completely unproblematic?
The text was updated successfully, but these errors were encountered:
The secret itself requires RngCore + CryptoRng and StdRng already impl that - but different version... The rest of the world use rand_core 0.6 but this crate use rand_core 0.5 so you'll get the trait bound "XxxRng: rand_core::RngCore" is not satisfied the trait "rand_core::RngCore" is not implemented for "XxxRng" the trait bound "XxxRng: rand_core::CryptoRng" is not satisfied the trait "rand_core::CryptoRng" is not implemented for "XxxRng"
There is a pr for version bump and everything should be fine and you can use StdRng or OsRng from rand_core 0.6 or whatever (hopefully, but nobody review or merge the pr)
Hi, this is more of a question than a issue.
In the example that you give of creating keypairs, you use the rand_core Osrng:
After reading a bit up on the osrng, I read that it was not a cryptographically secure source of randomness, and that I should use a resource that specifcally had a focus on that.
The most common option for a csprg, seems to be the StdRng in the rand crate. That I was advised to use.
Is it possible to use
use rand::{rngs::StdRng};
to create keypairs in your crate? or is the use of osrng completely unproblematic?The text was updated successfully, but these errors were encountered: