Migrate ff to rand_core 0.3 (used by rand 0.5)

This commit is contained in:
Jack Grigg
2019-07-10 18:35:05 -04:00
parent 9e758dc7d9
commit 7a6642b221
4 changed files with 43 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
#![allow(unused_imports)]
extern crate byteorder;
extern crate rand;
extern crate rand_core;
#[cfg(feature = "derive")]
#[macro_use]
@@ -10,14 +10,18 @@ extern crate ff_derive;
#[cfg(feature = "derive")]
pub use ff_derive::*;
use rand_core::RngCore;
use std::error::Error;
use std::fmt;
use std::io::{self, Read, Write};
/// This trait represents an element of a field.
pub trait Field:
Sized + Eq + Copy + Clone + Send + Sync + fmt::Debug + fmt::Display + 'static + rand::Rand
Sized + Eq + Copy + Clone + Send + Sync + fmt::Debug + fmt::Display + 'static
{
/// Returns an element chosen uniformly at random using a user-provided RNG.
fn random<R: RngCore>(rng: &mut R) -> Self;
/// Returns the zero element of the field, the additive identity.
fn zero() -> Self;
@@ -100,7 +104,6 @@ pub trait PrimeFieldRepr:
+ fmt::Debug
+ fmt::Display
+ 'static
+ rand::Rand
+ AsRef<[u64]>
+ AsMut<[u64]>
+ From<u64>