Skip to content
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

Upgrade rand dependency #45

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "x25519-dalek"
version = "0.5.2"
authors = [
"Isis Lovecruft <isis@patternsinthevoid.net>",
"Isis Lovecruft <isis@patternsinthevoid.net>",
"DebugSteven <debugsteven@gmail.com>",
"Henry de Valence <hdevalence@hdevalence.ca>",
]
Expand All @@ -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"
Expand Down
8 changes: 3 additions & 5 deletions src/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down