fix RngCore Sized

This commit is contained in:
Weiliang Li 2019-11-13 14:44:30 +09:00
parent 583c744a92
commit 98133d9935
5 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ edition ="2018"
[dependencies] [dependencies]
byteorder = "1" byteorder = "1"
ff = { version = "0.5.0", path = "../ff", features = ["derive"] } ff = { version = "0.6.0", path = "../ff", features = ["derive"] }
group = { version = "0.2.0", path = "../group" } group = { version = "0.2.0", path = "../group" }
rand_core = "0.5" rand_core = "0.5"

View File

@ -200,7 +200,7 @@ macro_rules! curve_impl {
type Base = $basefield; type Base = $basefield;
type Affine = $affine; type Affine = $affine;
fn random<R: RngCore>(rng: &mut R) -> Self { fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
loop { loop {
let x = $basefield::random(rng); let x = $basefield::random(rng);
let greatest = rng.next_u32() % 2 != 0; let greatest = rng.next_u32() % 2 != 0;

View File

@ -40,7 +40,7 @@ impl Fq12 {
} }
impl Field for Fq12 { impl Field for Fq12 {
fn random<R: RngCore>(rng: &mut R) -> Self { fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
Fq12 { Fq12 {
c0: Fq6::random(rng), c0: Fq6::random(rng),
c1: Fq6::random(rng), c1: Fq6::random(rng),

View File

@ -57,7 +57,7 @@ impl Fq2 {
} }
impl Field for Fq2 { impl Field for Fq2 {
fn random<R: RngCore>(rng: &mut R) -> Self { fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
Fq2 { Fq2 {
c0: Fq::random(rng), c0: Fq::random(rng),
c1: Fq::random(rng), c1: Fq::random(rng),

View File

@ -100,7 +100,7 @@ impl Fq6 {
} }
impl Field for Fq6 { impl Field for Fq6 {
fn random<R: RngCore>(rng: &mut R) -> Self { fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
Fq6 { Fq6 {
c0: Fq2::random(rng), c0: Fq2::random(rng),
c1: Fq2::random(rng), c1: Fq2::random(rng),