mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-09 23:41:30 +01:00
Upgrade to work with latest ark-ff (#95)
Co-authored-by: Sun <huachuang20@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user