diff --git a/Cargo.toml b/Cargo.toml index 41976ff..e4b7948 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "x25519-dalek" version = "0.5.2" authors = [ - "Isis Lovecruft ", + "Isis Lovecruft ", "DebugSteven ", "Henry de Valence ", ] @@ -29,12 +29,12 @@ features = ["nightly"] [dependencies] curve25519-dalek = { version = "1", default-features = false } -rand_core = { version = "0.3", default-features = false } -clear_on_drop = { version = "0.2" } +rand_core = { version = "0.5.0", default-features = false } +clear_on_drop = "0.2" [dev-dependencies] criterion = "0.2" -rand_os = "0.1" +rand_os = "0.2.1" [[bench]] name = "x25519" diff --git a/src/x25519.rs b/src/x25519.rs index 30f5bdb..773c1bc 100644 --- a/src/x25519.rs +++ b/src/x25519.rs @@ -20,8 +20,7 @@ use curve25519_dalek::constants::ED25519_BASEPOINT_TABLE; use curve25519_dalek::montgomery::MontgomeryPoint; use curve25519_dalek::scalar::Scalar; -use rand_core::RngCore; -use rand_core::CryptoRng; +use rand_core::{CryptoRng, RngCore}; /// A `PublicKey` is the corresponding public key converted from /// an `EphemeralSecret` or a `StaticSecret` key. @@ -200,10 +199,9 @@ mod test { // lives here. #[test] fn alice_and_bob() { - let mut csprng = OsRng::new().unwrap(); - let alice_secret = EphemeralSecret::new(&mut csprng); + let alice_secret = EphemeralSecret::new(&mut OsRng); let alice_public = PublicKey::from(&alice_secret); - let bob_secret = EphemeralSecret::new(&mut csprng); + let bob_secret = EphemeralSecret::new(&mut OsRng); let bob_public = PublicKey::from(&bob_secret); let alice_shared_secret = alice_secret.diffie_hellman(&bob_public); let bob_shared_secret = bob_secret.diffie_hellman(&alice_public);