Upgrade to work with latest ark-ff (#95)

Co-authored-by: Sun <huachuang20@gmail.com>
This commit is contained in:
Pratyush Mishra
2022-03-07 13:12:03 -08:00
committed by GitHub
parent d0dc200f22
commit 1551d6d76c
231 changed files with 2830 additions and 4343 deletions

View File

@@ -7,8 +7,8 @@ use ark_bn254::{
};
use ark_ec::{PairingEngine, ProjectiveCurve};
use ark_ff::{
biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr},
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
biginteger::BigInteger256 as FrRepr, BigInteger, Field, PrimeField, SquareRootField,
UniformRand,
};
mod g1 {

View File

@@ -4,8 +4,8 @@ use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::ProjectiveCurve;
use ark_ed_on_bls12_381::{fq::Fq, fr::Fr, EdwardsAffine as GAffine, EdwardsProjective as G};
use ark_ff::{
biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr},
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
biginteger::BigInteger256 as FrRepr, BigInteger, Field, PrimeField, SquareRootField,
UniformRand,
};
mod g {

View File

@@ -3,8 +3,8 @@ use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::ProjectiveCurve;
use ark_ff::{
biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr},
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
biginteger::BigInteger256 as FrRepr, BigInteger, Field, PrimeField, SquareRootField,
UniformRand,
};
use ark_pallas::{fq::Fq, fr::Fr, Affine as GAffine, Projective as G};

View File

@@ -3,8 +3,8 @@ use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::ProjectiveCurve;
use ark_ff::{
biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr},
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
biginteger::BigInteger256 as FrRepr, BigInteger, Field, PrimeField, SquareRootField,
UniformRand,
};
use ark_vesta::{fq::Fq, fr::Fr, Affine as GAffine, Projective as G};

View File

@@ -231,7 +231,7 @@ macro_rules! ec_bench {
let g = <$projective>::rand(&mut rng).into_affine();
let v: Vec<_> = (0..SAMPLES).map(|_| g).collect();
let scalars: Vec<_> = (0..SAMPLES)
.map(|_| Fr::rand(&mut rng).into_repr())
.map(|_| Fr::rand(&mut rng).into_bigint())
.collect();
b.bench_n(1, |b| {
b.iter(|| ark_ec::msm::VariableBase::msm(&v, &scalars));

View File

@@ -343,7 +343,7 @@ macro_rules! prime_field {
let mut count = 0;
b.iter(|| {
let mut tmp = v[count].0;
n_fold!(tmp, v, add_nocarry, count);
n_fold!(tmp, v, add_with_carry, count);
count = (count + 1) % SAMPLES;
tmp
});
@@ -369,7 +369,7 @@ macro_rules! prime_field {
let mut count = 0;
b.iter(|| {
let mut tmp = v[count].0;
n_fold!(tmp, v, sub_noborrow, count);
n_fold!(tmp, v, sub_with_borrow, count);
count = (count + 1) % SAMPLES;
tmp;
});
@@ -432,7 +432,7 @@ macro_rules! prime_field {
let mut count = 0;
b.iter(|| {
count = (count + 1) % SAMPLES;
v[count].into_repr();
v[count].into_bigint();
});
}
@@ -442,7 +442,7 @@ macro_rules! prime_field {
let mut rng = ark_std::test_rng();
let v: Vec<$f_repr_type> = (0..SAMPLES)
.map(|_| $f::rand(&mut rng).into_repr())
.map(|_| $f::rand(&mut rng).into_bigint())
.collect();
let mut count = 0;