Rand 0.6 version bump

This commit is contained in:
Colt Frederickson 2018-10-17 10:26:44 -06:00
parent 12c5777b23
commit 42b5d6ada9
3 changed files with 32 additions and 15 deletions

View file

@ -16,11 +16,12 @@ exclude = [ ".gitignore", "TESTVECTORS", "res/*" ]
travis-ci = { repository = "dalek-cryptography/ed25519-dalek", branch = "master"} travis-ci = { repository = "dalek-cryptography/ed25519-dalek", branch = "master"}
[dependencies.curve25519-dalek] [dependencies.curve25519-dalek]
version = "1.0.0-pre.0" git = "https://github.com/IronCoreLabs/curve25519-dalek.git"
branch = "rand-0.6"
default-features = false default-features = false
[dependencies.rand] [dependencies.rand]
version = "0.5" version = "0.6.0"
default-features = false default-features = false
features = ["i128_support"] features = ["i128_support"]
@ -44,6 +45,7 @@ hex = "^0.3"
sha2 = "^0.8" sha2 = "^0.8"
bincode = "^0.9" bincode = "^0.9"
criterion = "0.2" criterion = "0.2"
rand_chacha = "0.1.0"
[[bench]] [[bench]]
name = "ed25519_benchmarks" name = "ed25519_benchmarks"

View file

@ -281,13 +281,14 @@ impl SecretKey {
/// ///
/// ``` /// ```
/// # extern crate rand; /// # extern crate rand;
/// # extern crate rand_chacha;
/// # extern crate sha2; /// # extern crate sha2;
/// # extern crate ed25519_dalek; /// # extern crate ed25519_dalek;
/// # /// #
/// # fn main() { /// # fn main() {
/// # /// #
/// # use rand::Rng; /// # use rand::Rng;
/// # use rand::ChaChaRng; /// # use rand_chacha::ChaChaRng;
/// # use rand::SeedableRng; /// # use rand::SeedableRng;
/// # use sha2::Sha512; /// # use sha2::Sha512;
/// # use ed25519_dalek::PublicKey; /// # use ed25519_dalek::PublicKey;
@ -307,7 +308,7 @@ impl SecretKey {
/// ///
/// # Input /// # 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 pub fn generate<T>(csprng: &mut T) -> SecretKey
where T: CryptoRng + Rng, where T: CryptoRng + Rng,
{ {
@ -939,7 +940,7 @@ impl From<ExpandedSecretKey> for PublicKey {
/// use ed25519_dalek::PublicKey; /// use ed25519_dalek::PublicKey;
/// use ed25519_dalek::Signature; /// use ed25519_dalek::Signature;
/// use rand::thread_rng; /// use rand::thread_rng;
/// use rand::ThreadRng; /// use rand::rngs::ThreadRng;
/// use sha2::Sha512; /// use sha2::Sha512;
/// ///
/// # fn main() { /// # fn main() {
@ -1135,7 +1136,7 @@ impl Keypair {
/// ///
/// # Input /// # 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 /// The caller must also supply a hash function which implements the
/// `Digest` and `Default` traits, and which returns 512 bits of output. /// `Digest` and `Default` traits, and which returns 512 bits of output.
@ -1380,9 +1381,9 @@ mod test {
use std::string::String; use std::string::String;
use std::vec::Vec; use std::vec::Vec;
use rand::thread_rng; use rand::thread_rng;
use rand::ChaChaRng; use rand_chacha::ChaChaRng;
use rand::SeedableRng; use rand::SeedableRng;
use rand::ThreadRng; use rand::rngs::ThreadRng;
use hex::FromHex; use hex::FromHex;
use sha2::Sha512; use sha2::Sha512;
use super::*; use super::*;

View file

@ -44,11 +44,12 @@
//! //!
//! ``` //! ```
//! # extern crate rand; //! # extern crate rand;
//! # extern crate rand_chacha;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # fn main() { //! # fn main() {
//! # use rand::Rng; //! # use rand::Rng;
//! # use rand::ChaChaRng; //! # use rand_chacha::ChaChaRng;
//! # use rand::SeedableRng; //! # use rand::SeedableRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::Keypair; //! # use ed25519_dalek::Keypair;
@ -67,9 +68,10 @@
//! # extern crate rand; //! # extern crate rand;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # fn main() { //! # fn main() {
//! # use rand::Rng; //! # use rand::Rng;
//! # use rand::ChaChaRng; //! # use rand_chacha::ChaChaRng;
//! # use rand::SeedableRng; //! # use rand::SeedableRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::Keypair; //! # use ed25519_dalek::Keypair;
@ -89,9 +91,10 @@
//! # extern crate rand; //! # extern crate rand;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # fn main() { //! # fn main() {
//! # use rand::Rng; //! # use rand::Rng;
//! # use rand::ChaChaRng; //! # use rand_chacha::ChaChaRng;
//! # use rand::SeedableRng; //! # use rand::SeedableRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::Keypair; //! # use ed25519_dalek::Keypair;
@ -119,8 +122,10 @@
//! # extern crate rand; //! # extern crate rand;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # fn main() { //! # fn main() {
//! # use rand::{Rng, ChaChaRng, SeedableRng}; //! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey}; //! # use ed25519_dalek::{Keypair, Signature, PublicKey};
//! use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH}; //! use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
@ -142,8 +147,10 @@
//! ``` //! ```
//! # extern crate rand; //! # extern crate rand;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate rand_chacha;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # use rand::{Rng, ChaChaRng, SeedableRng}; //! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey, SecretKey, SignatureError}; //! # use ed25519_dalek::{Keypair, Signature, PublicKey, SecretKey, SignatureError};
//! # use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH}; //! # use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
@ -186,6 +193,7 @@
//! # extern crate rand; //! # extern crate rand;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # #[cfg(feature = "serde")] //! # #[cfg(feature = "serde")]
//! extern crate serde; //! extern crate serde;
//! # #[cfg(feature = "serde")] //! # #[cfg(feature = "serde")]
@ -193,7 +201,8 @@
//! //!
//! # #[cfg(feature = "serde")] //! # #[cfg(feature = "serde")]
//! # fn main() { //! # fn main() {
//! # use rand::{Rng, ChaChaRng, SeedableRng}; //! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey}; //! # use ed25519_dalek::{Keypair, Signature, PublicKey};
//! use bincode::{serialize, Infinite}; //! use bincode::{serialize, Infinite};
@ -218,6 +227,7 @@
//! # extern crate rand; //! # extern crate rand;
//! # extern crate sha2; //! # extern crate sha2;
//! # extern crate ed25519_dalek; //! # extern crate ed25519_dalek;
//! # extern crate rand_chacha;
//! # #[cfg(feature = "serde")] //! # #[cfg(feature = "serde")]
//! # extern crate serde; //! # extern crate serde;
//! # #[cfg(feature = "serde")] //! # #[cfg(feature = "serde")]
@ -225,7 +235,8 @@
//! # //! #
//! # #[cfg(feature = "serde")] //! # #[cfg(feature = "serde")]
//! # fn main() { //! # fn main() {
//! # use rand::{Rng, ChaChaRng, SeedableRng}; //! # use rand::{Rng, SeedableRng};
//! # use rand_chacha::ChaChaRng;
//! # use sha2::Sha512; //! # use sha2::Sha512;
//! # use ed25519_dalek::{Keypair, Signature, PublicKey}; //! # use ed25519_dalek::{Keypair, Signature, PublicKey};
//! # use bincode::{serialize, Infinite}; //! # use bincode::{serialize, Infinite};
@ -272,6 +283,9 @@ extern crate sha2;
#[cfg(test)] #[cfg(test)]
extern crate hex; extern crate hex;
#[cfg(test)]
extern crate rand_chacha;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
extern crate serde; extern crate serde;