mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-11 08:21:33 +01:00
Initial commit
This commit is contained in:
23
curve-benches/src/curves/bls12_377.rs
Normal file
23
curve-benches/src/curves/bls12_377.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_bls12_377::bls12_377::{
|
||||
fq::Fq, fq2::Fq2, fr::Fr, Bls12_377, Fq12, G1Affine, G1Projective as G1, G2Affine,
|
||||
G2Projective as G2, Parameters,
|
||||
};
|
||||
use ark_ec::{
|
||||
bls12::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::{BigInteger256 as FrRepr, BigInteger384 as FqRepr},
|
||||
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq2, Fq2, fq2);
|
||||
f_bench!(2, Fq12, Fq12, fq12);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
|
||||
pairing_bench!(Bls12_377, Fq12, prepared_v);
|
||||
23
curve-benches/src/curves/bls12_381.rs
Normal file
23
curve-benches/src/curves/bls12_381.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_bls12_381::bls12_381::{
|
||||
fq::Fq, fq2::Fq2, fr::Fr, Bls12_381, Fq12, G1Affine, G1Projective as G1, G2Affine,
|
||||
G2Projective as G2, Parameters,
|
||||
};
|
||||
use ark_ec::{
|
||||
bls12::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::{BigInteger256 as FrRepr, BigInteger384 as FqRepr},
|
||||
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq2, Fq2, fq2);
|
||||
f_bench!(2, Fq12, Fq12, fq12);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
|
||||
pairing_bench!(Bls12_381, Fq12, prepared_v);
|
||||
23
curve-benches/src/curves/bn254.rs
Normal file
23
curve-benches/src/curves/bn254.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_ec::{
|
||||
bn::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ef::{
|
||||
biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr},
|
||||
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
|
||||
};
|
||||
use ark_en254::bn254::{
|
||||
fq::Fq, fq2::Fq2, fr::Fr, Bls12_381, Fq12, G1Affine, G1Projective as G1, G2Affine,
|
||||
G2Projective as G2, Parameters,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq2, Fq2, fq2);
|
||||
f_bench!(2, Fq12, Fq12, fq12);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
|
||||
pairing_bench!(Bn254, Fq12, prepared_v);
|
||||
23
curve-benches/src/curves/bw6_761.rs
Normal file
23
curve-benches/src/curves/bw6_761.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_bls12_377::bw6_761::{
|
||||
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
|
||||
Parameters, BW6_761,
|
||||
};
|
||||
use ark_ec::{
|
||||
bw6::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::{BigInteger384 as FrRepr, BigInteger768 as FqRepr},
|
||||
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq3, Fq3, fq3);
|
||||
f_bench!(2, Fq6, Fq6, fq6);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
|
||||
pairing_bench!(BW6_761, Fq6, prepared_v);
|
||||
20
curve-benches/src/curves/cp6_782.rs
Normal file
20
curve-benches/src/curves/cp6_782.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_bls12_377::cp6_782::{
|
||||
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
|
||||
CP6_782,
|
||||
};
|
||||
use ark_ec::{PairingEngine, ProjectiveCurve};
|
||||
use ark_ff::{
|
||||
biginteger::{BigInteger384 as FrRepr, BigInteger832 as FqRepr},
|
||||
BigInteger, Field, PrimeField, SquareRootField, UniformRand,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq3, Fq3, fq3);
|
||||
f_bench!(2, Fq6, Fq6, fq6);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
|
||||
pairing_bench!(CP6_782, Fq6, affine_v);
|
||||
22
curve-benches/src/curves/mnt4_298.rs
Normal file
22
curve-benches/src/curves/mnt4_298.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_ec::{
|
||||
mnt4::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger320 as FqRepr, BigInteger, Field, PrimeField, SquareRootField,
|
||||
UniformRand,
|
||||
};
|
||||
use ark_mnt_298::mnt4_298::{
|
||||
fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
|
||||
Parameters, MNT4_298,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq2, Fq2, fq2);
|
||||
f_bench!(2, Fq4, Fq4, fq4);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
pairing_bench!(MNT4_298, Fq4, prepared_v);
|
||||
22
curve-benches/src/curves/mnt4_753.rs
Normal file
22
curve-benches/src/curves/mnt4_753.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_ec::{
|
||||
mnt4::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger768 as FqRepr, BigInteger, Field, PrimeField, SquareRootField,
|
||||
UniformRand,
|
||||
};
|
||||
use ark_mnt_753::mnt4_753::{
|
||||
fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
|
||||
Parameters, MNT4_753,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq2, Fq2, fq2);
|
||||
f_bench!(2, Fq4, Fq4, fq4);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
pairing_bench!(MNT4_753, Fq4, prepared_v);
|
||||
22
curve-benches/src/curves/mnt6_298.rs
Normal file
22
curve-benches/src/curves/mnt6_298.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_ec::{
|
||||
mnt6::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger320 as FqRepr, BigInteger, Field, PrimeField, SquareRootField,
|
||||
UniformRand,
|
||||
};
|
||||
use ark_mnt_298::mnt6_298::{
|
||||
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
|
||||
Parameters, MNT6_298,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq3, Fq3, fq3);
|
||||
f_bench!(2, Fq6, Fq6, fq6);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
pairing_bench!(MNT6_298, Fq6, prepared_v);
|
||||
22
curve-benches/src/curves/mnt6_753.rs
Normal file
22
curve-benches/src/curves/mnt6_753.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use rand::SeedableRng;
|
||||
use rand_xorshift::XorShiftRng;
|
||||
use std::ops::{AddAssign, MulAssign, SubAssign};
|
||||
|
||||
use ark_ec::{
|
||||
mnt6::{G1Prepared, G2Prepared},
|
||||
PairingEngine, ProjectiveCurve,
|
||||
};
|
||||
use ark_ff::{
|
||||
biginteger::BigInteger768 as FqRepr, BigInteger, Field, PrimeField, SquareRootField,
|
||||
UniformRand,
|
||||
};
|
||||
use ark_mnt_753::mnt6_753::{
|
||||
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
|
||||
Parameters, MNT6_753,
|
||||
};
|
||||
|
||||
ec_bench!();
|
||||
f_bench!(1, Fq3, Fq3, fq3);
|
||||
f_bench!(2, Fq6, Fq6, fq6);
|
||||
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
|
||||
pairing_bench!(MNT6_753, Fq6, prepared_v);
|
||||
18
curve-benches/src/curves/mod.rs
Normal file
18
curve-benches/src/curves/mod.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
#[cfg(feature = "bls12_377")]
|
||||
mod bls12_377;
|
||||
#[cfg(feature = "bls12_381")]
|
||||
mod bls12_381;
|
||||
#[cfg(feature = "bn254")]
|
||||
mod bn254;
|
||||
#[cfg(feature = "bw6_761")]
|
||||
mod bw6_761;
|
||||
#[cfg(feature = "cp6_782")]
|
||||
mod cp6_782;
|
||||
#[cfg(feature = "mnt4_298")]
|
||||
mod mnt4_298;
|
||||
#[cfg(feature = "mnt4_753")]
|
||||
mod mnt4_753;
|
||||
#[cfg(feature = "mnt6_298")]
|
||||
mod mnt6_298;
|
||||
#[cfg(feature = "mnt6_753")]
|
||||
mod mnt6_753;
|
||||
Reference in New Issue
Block a user