mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
Merge pull request #57 from IronCoreLabs/rand-0.6
Rand 0.6 version bump
This commit is contained in:
commit
85285576a7
3 changed files with 31 additions and 15 deletions
|
|
@ -16,11 +16,11 @@ 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"
|
version = "1.0.0-pre.1"
|
||||||
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 +44,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"
|
||||||
|
|
|
||||||
|
|
@ -287,13 +287,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;
|
||||||
|
|
@ -313,7 +314,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,
|
||||||
{
|
{
|
||||||
|
|
@ -951,7 +952,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() {
|
||||||
|
|
@ -1147,7 +1148,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.
|
||||||
|
|
@ -1392,9 +1393,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::*;
|
||||||
|
|
|
||||||
28
src/lib.rs
28
src/lib.rs
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue