Skip to content

Commit

Permalink
Merge pull request dalek-cryptography#57 from IronCoreLabs/rand-0.6
Browse files Browse the repository at this point in the history
Rand 0.6 version bump
  • Loading branch information
isislovecruft authored Dec 18, 2018
2 parents 0dab894 + 1132665 commit 8528557
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ exclude = [ ".gitignore", "TESTVECTORS", "res/*" ]
travis-ci = { repository = "dalek-cryptography/ed25519-dalek", branch = "master"}

[dependencies.curve25519-dalek]
version = "1.0.0-pre.0"
version = "1.0.0-pre.1"
default-features = false

[dependencies.rand]
version = "0.5"
version = "0.6.0"
default-features = false
features = ["i128_support"]

Expand All @@ -44,6 +44,7 @@ hex = "^0.3"
sha2 = "^0.8"
bincode = "^0.9"
criterion = "0.2"
rand_chacha = "0.1.0"

[[bench]]
name = "ed25519_benchmarks"
Expand Down
13 changes: 7 additions & 6 deletions src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,14 @@ impl SecretKey {
///
/// ```
/// # extern crate rand;
/// # extern crate rand_chacha;
/// # extern crate sha2;
/// # extern crate ed25519_dalek;
/// #
/// # fn main() {
/// #
/// # use rand::Rng;
/// # use rand::ChaChaRng;
/// # use rand_chacha::ChaChaRng;
/// # use rand::SeedableRng;
/// # use sha2::Sha512;
/// # use ed25519_dalek::PublicKey;
Expand All @@ -313,7 +314,7 @@ impl SecretKey {
///
/// # Input
///
/// A CSPRNG with a `fill_bytes()` method, e.g. `rand::ChaChaRng`
/// A CSPRNG with a `fill_bytes()` method, e.g. `rand_chacha::ChaChaRng`
pub fn generate<T>(csprng: &mut T) -> SecretKey
where T: CryptoRng + Rng,
{
Expand Down Expand Up @@ -951,7 +952,7 @@ impl From<ExpandedSecretKey> for PublicKey {
/// use ed25519_dalek::PublicKey;
/// use ed25519_dalek::Signature;
/// use rand::thread_rng;
/// use rand::ThreadRng;
/// use rand::rngs::ThreadRng;
/// use sha2::Sha512;
///
/// # fn main() {
Expand Down Expand Up @@ -1147,7 +1148,7 @@ impl Keypair {
///
/// # Input
///
/// A CSPRNG with a `fill_bytes()` method, e.g. `rand::ChaChaRng`.
/// A CSPRNG with a `fill_bytes()` method, e.g. `rand_chacha::ChaChaRng`.
///
/// The caller must also supply a hash function which implements the
/// `Digest` and `Default` traits, and which returns 512 bits of output.
Expand Down Expand Up @@ -1392,9 +1393,9 @@ mod test {
use std::string::String;
use std::vec::Vec;
use rand::thread_rng;
use rand::ChaChaRng;
use rand_chacha::ChaChaRng;
use rand::SeedableRng;
use rand::ThreadRng;
use rand::rngs::ThreadRng;
use hex::FromHex;
use sha2::Sha512;
use super::*;
Expand Down
28 changes: 21 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
//!
//! ```
//! # extern crate rand;
//! # extern crate rand_chacha;
//! # extern crate sha2;
//! # extern crate ed25519_dalek;
//! # fn main() {
//! # use rand::Rng;
//! # use rand::ChaChaRng;
//! # use rand_chacha::ChaChaRng;
//! # use rand::SeedableRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::Keypair;
Expand All @@ -67,9 +68,10 @@
//! # extern crate rand;
//! # extern crate sha2;
//! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # fn main() {
//! # use rand::Rng;
//! # use rand::ChaChaRng;
//! # use rand_chacha::ChaChaRng;
//! # use rand::SeedableRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::Keypair;
Expand All @@ -89,9 +91,10 @@
//! # extern crate rand;
//! # extern crate sha2;
//! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # fn main() {
//! # use rand::Rng;
//! # use rand::ChaChaRng;
//! # use rand_chacha::ChaChaRng;
//! # use rand::SeedableRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::Keypair;
Expand Down Expand Up @@ -119,8 +122,10 @@
//! # extern crate rand;
//! # extern crate sha2;
//! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # fn main() {
//! # use rand::{Rng, ChaChaRng, SeedableRng};
//! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey};
//! use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
Expand All @@ -142,8 +147,10 @@
//! ```
//! # extern crate rand;
//! # extern crate sha2;
//! # extern crate rand_chacha;
//! # extern crate ed25519_dalek;
//! # use rand::{Rng, ChaChaRng, SeedableRng};
//! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey, SecretKey, SignatureError};
//! # use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
Expand Down Expand Up @@ -186,14 +193,16 @@
//! # extern crate rand;
//! # extern crate sha2;
//! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # #[cfg(feature = "serde")]
//! extern crate serde;
//! # #[cfg(feature = "serde")]
//! extern crate bincode;
//!
//! # #[cfg(feature = "serde")]
//! # fn main() {
//! # use rand::{Rng, ChaChaRng, SeedableRng};
//! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey};
//! use bincode::{serialize, Infinite};
Expand All @@ -218,14 +227,16 @@
//! # extern crate rand;
//! # extern crate sha2;
//! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # #[cfg(feature = "serde")]
//! # extern crate serde;
//! # #[cfg(feature = "serde")]
//! # extern crate bincode;
//! #
//! # #[cfg(feature = "serde")]
//! # fn main() {
//! # use rand::{Rng, ChaChaRng, SeedableRng};
//! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey};
//! # use bincode::{serialize, Infinite};
Expand Down Expand Up @@ -272,6 +283,9 @@ extern crate sha2;
#[cfg(test)]
extern crate hex;

#[cfg(test)]
extern crate rand_chacha;

#[cfg(feature = "serde")]
extern crate serde;

Expand Down

0 comments on commit 8528557

Please sign in to comment.