Skip to content

Commit

Permalink
update rand_core version
Browse files Browse the repository at this point in the history
Co-authored-by: Greg <gregory.mkv@gmail.com>
  • Loading branch information
DebugSteven and chmln committed Nov 26, 2019
1 parent b651a5e commit 01bcb9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ features = ["nightly"]

[dependencies]
curve25519-dalek = { version = "2", default-features = false }
rand_core = { version = "0.3", default-features = false }
rand_core = { version = "0.5", default-features = false }
# `serde` is renamed to `our_serde` in order to avoid a name collision between
# importing the serde dependency and enabling the curve25519-dalek/serde feature
our_serde = { package = "serde", version = "1", default-features = false, optional = true, features = ["derive"] }
Expand All @@ -39,7 +39,6 @@ zeroize = { version = "1", default-features = false, features = ["zeroize_derive
[dev-dependencies]
bincode = "1"
criterion = "0.2"
rand_os = "0.1"

[[bench]]
name = "x25519"
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ extern crate rand_core;

extern crate zeroize;

#[cfg(test)]
extern crate rand_os;

mod x25519;

pub use crate::x25519::*;
7 changes: 3 additions & 4 deletions src/x25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,16 @@ impl From<AllowUnreducedScalarBytes> for Scalar {
mod test {
use super::*;

use rand_os::OsRng;
use rand_core::OsRng;

// This was previously a doctest but it got moved to the README to
// avoid duplication where it then wasn't being run, so now it
// 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

0 comments on commit 01bcb9b

Please sign in to comment.