* push * push * cargo ready Co-authored-by: onewayfunc <onewayfunc@gmail.com>cherry-pick
@ -1,19 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
curves::{curve_tests, edwards_tests, sw_tests},
|
|
||||
generate_bilinearity_test, generate_g1_generator_raw_test, generate_g1_test, generate_g2_test,
|
|
||||
msm::test_var_base_msm,
|
|
||||
};
|
|
||||
use ark_ec::{models::short_weierstrass::SWCurveConfig, AffineRepr, PairingEngine};
|
|
||||
use ark_ff::{
|
|
||||
fields::{Field, PrimeField},
|
|
||||
One, Zero,
|
|
||||
};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign};
|
|
||||
|
use crate::{Bls12_377, G1Projective, G2Projective};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{g1, g2, Bls12_377, Fq, Fq12, Fr, G1Affine, G1Projective, G2Affine, G2Projective};
|
|
||||
|
|
||||
generate_g1_test!(bls12_377; curve_tests; sw_tests; edwards_tests;);
|
|
||||
generate_g2_test!(bls12_377; curve_tests; sw_tests;);
|
|
||||
generate_bilinearity_test!(Bls12_377, Fq12);
|
|
||||
generate_g1_generator_raw_test!(bls12_377, 1);
|
|
||||
|
test_group!(g1; G1Projective; sw);
|
||||
|
test_group!(g2; G2Projective; sw);
|
||||
|
test_group!(pairing_output; ark_ec::pairing::PairingOutput<Bls12_377>; msm);
|
||||
|
test_pairing!(pairing; crate::Bls12_377);
|
@ -1,23 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::AffineRepr;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<EdwardsProjective>();
|
|
||||
|
|
||||
edwards_tests::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,15 +1,5 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{
|
|
||||
fields::{Field, PrimeField},
|
|
||||
One, UniformRand, Zero,
|
|
||||
};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
use crate::{Fq, Fr};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Fq, FqConfig, Fr, FrConfig};
|
|
||||
|
|
||||
generate_field_test!(ed_on_bls12_377; mont(4, 4); );
|
|
||||
generate_field_serialization_test!(ed_on_bls12_377;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
@ -1,63 +1,5 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::{AffineRepr, ProjectiveCurve};
|
|
||||
use ark_ff::Zero;
|
|
||||
use ark_std::{ops::Mul, str::FromStr};
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<EdwardsProjective>();
|
|
||||
|
|
||||
edwards_tests::<JubjubParameters>();
|
|
||||
montgomery_conversion_test::<JubjubParameters>();
|
|
||||
sw_tests::<JubjubParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
// edward curve
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
|
|
||||
// weierstrass curve
|
|
||||
let generator = SWAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_scalar_multiplication() {
|
|
||||
let f1 = Fr::from_str(
|
|
||||
"4691331900926794624732159288782398864809513177368446695323460897088210774597",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
let f2 = Fr::from_str(
|
|
||||
"1305028103380024953477151132159456965337646722479526711736847301646466538045",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
|
|
||||
let g = EdwardsAffine::from_str(
|
|
||||
"(1158870117176967269192899343636553522971009777237254192973081388797299308391, \
|
|
||||
36933624999642413792569726058244472742169727126562409632889593958355839948294)",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
let f1f2g = EdwardsAffine::from_str(
|
|
||||
"(12638652891150111215300246576936483137884466359309882317048163368620501191944, \
|
|
||||
38385045634663742820428406709832518145724237919360177362175527604556651918148)",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
|
|
||||
assert!(!g.is_zero());
|
|
||||
assert!(!f1f2g.is_zero());
|
|
||||
|
|
||||
let f1g = g.mul(f1).into_affine();
|
|
||||
assert_eq!(g.mul(f1 * &f2).into_affine(), f1f2g);
|
|
||||
assert_eq!(f1g.mul(f2).into_affine(), f1f2g);
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<JubjubParameters>();
|
|
||||
}
|
|
||||
|
test_group!(sw; SWProjective; sw);
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,63 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::{AffineRepr, ProjectiveCurve};
|
|
||||
use ark_ff::Zero;
|
|
||||
use ark_std::{ops::Mul, str::FromStr};
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<EdwardsProjective>();
|
|
||||
|
|
||||
edwards_tests::<BandersnatchParameters>();
|
|
||||
montgomery_conversion_test::<BandersnatchParameters>();
|
|
||||
sw_tests::<BandersnatchParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
// edward curve
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
|
|
||||
// weierstrass curve
|
|
||||
let generator = SWAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_scalar_multiplication() {
|
|
||||
let f1 = Fr::from_str(
|
|
||||
"4257185345094557079734489188109952172285839137338142340240392707284963971010",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
let f2 = Fr::from_str(
|
|
||||
"1617998875791656082457755819308421023664764572929977389209373068350490665160",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
|
|
||||
let g = EdwardsAffine::from_str(
|
|
||||
"(29627151942733444043031429156003786749302466371339015363120350521834195802525, \
|
|
||||
27488387519748396681411951718153463804682561779047093991696427532072116857978)",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
let f1f2g = EdwardsAffine::from_str(
|
|
||||
"(16530491029447613915334753043669938793793987372416328257719459807614119987301, \
|
|
||||
42481140308370805476764840229335460092474682686441442216596889726548353970772)",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
|
|
||||
assert!(!g.is_zero());
|
|
||||
assert!(!f1f2g.is_zero());
|
|
||||
|
|
||||
let f1g = g.mul(f1).into_affine();
|
|
||||
assert_eq!(g.mul(f1 * &f2).into_affine(), f1f2g);
|
|
||||
assert_eq!(f1g.mul(f2).into_affine(), f1f2g);
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<BandersnatchParameters>();
|
|
||||
}
|
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,55 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::{AffineRepr, ProjectiveCurve};
|
|
||||
use ark_ff::Zero;
|
|
||||
use ark_std::{ops::Mul, str::FromStr};
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<EdwardsProjective>();
|
|
||||
|
|
||||
edwards_tests::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_scalar_multiplication() {
|
|
||||
let f1 = Fr::from_str(
|
|
||||
"4691331900926794624732159288782398864809513177368446695323460897088210774597",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
let f2 = Fr::from_str(
|
|
||||
"1305028103380024953477151132159456965337646722479526711736847301646466538045",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
|
|
||||
let g = EdwardsAffine::from_str(
|
|
||||
"(15863623088992515880085393097393553694825975317405843389771115419751650972659, \
|
|
||||
16950150798460657717958625567821834550301663161624707787222815936182638968203)",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
let f1f2g = EdwardsAffine::from_str(
|
|
||||
"(20773645713088336957786354488799297695596635653208610804806657050882264237947, \
|
|
||||
19987327827845206670850937090314462639017692512983955920885166014935289314257)",
|
|
||||
)
|
|
||||
.unwrap();
|
|
||||
|
|
||||
assert!(!g.is_zero());
|
|
||||
assert!(!f1f2g.is_zero());
|
|
||||
|
|
||||
let f1g = g.mul(f1).into_affine();
|
|
||||
assert_eq!(g.mul(f1 * &f2).into_affine(), f1f2g);
|
|
||||
assert_eq!(f1g.mul(f2).into_affine(), f1f2g);
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,23 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::AffineRepr;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<EdwardsProjective>();
|
|
||||
|
|
||||
edwards_tests::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,12 +1,5 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
use crate::{Fq, Fr};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Fq, FqConfig, Fr, FrConfig};
|
|
||||
|
|
||||
generate_field_test!(ed_on_cp6_782; mont(6, 6); );
|
|
||||
generate_field_serialization_test!(ed_on_cp6_782;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
@ -1,16 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::AffineRepr;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,12 +1,5 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
use crate::{Fq, Fr};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Fq, FqConfig, Fr, FrConfig};
|
|
||||
|
|
||||
generate_field_test!(ed_on_mnt4_298; mont(5, 5); );
|
|
||||
generate_field_serialization_test!(ed_on_mnt4_298;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
@ -1,23 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::*;
|
|
||||
use ark_ec::AffineRepr;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<EdwardsProjective>();
|
|
||||
|
|
||||
edwards_tests::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = EdwardsAffine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_montgomery_conversion() {
|
|
||||
montgomery_conversion_test::<EdwardsParameters>();
|
|
||||
}
|
|
||||
|
test_group!(te; EdwardsProjective; te);
|
@ -1,12 +1,5 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
use crate::{Fq, Fr};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Fq, FqConfig, Fr, FrConfig};
|
|
||||
|
|
||||
generate_field_test!(ed_on_mnt4_753; mont(12, 12); );
|
|
||||
generate_field_serialization_test!(ed_on_mnt4_753;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
@ -1,15 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
curves::*, generate_bilinearity_test, generate_g1_test, generate_g2_test,
|
|
||||
generate_product_of_pairings_test, msm::*,
|
|
||||
};
|
|
||||
use ark_ec::{AffineRepr, PairingEngine, ProjectiveCurve};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::MulAssign;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
generate_g1_test!(mnt4_298; curve_tests; sw_tests;);
|
|
||||
generate_g2_test!(mnt4_298; curve_tests; sw_tests;);
|
|
||||
generate_bilinearity_test!(MNT4_298, Fq4);
|
|
||||
generate_product_of_pairings_test!(MNT4_298);
|
|
||||
|
test_group!(g1; G1Projective; sw);
|
||||
|
test_group!(g2; G2Projective; sw);
|
||||
|
test_group!(pairing_output; ark_ec::pairing::PairingOutput<MNT4_298>; msm);
|
||||
|
test_pairing!(pairing; crate::MNT4_298);
|
@ -1,12 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
generate_field_test!(mnt4_298; fq2; fq4; mont(5, 5); );
|
|
||||
generate_field_serialization_test!(mnt4_298;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
||||
|
test_field!(fq2; Fq2);
|
||||
|
test_field!(fq4; Fq4);
|
@ -1,15 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
curves::*, generate_bilinearity_test, generate_g1_test, generate_g2_test,
|
|
||||
generate_product_of_pairings_test, msm::*,
|
|
||||
};
|
|
||||
use ark_ec::{AffineRepr, PairingEngine, ProjectiveCurve};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::MulAssign;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
generate_g1_test!(mnt4_753; curve_tests; sw_tests;);
|
|
||||
generate_g2_test!(mnt4_753; curve_tests; sw_tests;);
|
|
||||
generate_bilinearity_test!(MNT4_753, Fq4);
|
|
||||
generate_product_of_pairings_test!(MNT4_753);
|
|
||||
|
test_group!(g1; G1Projective; sw);
|
||||
|
test_group!(g2; G2Projective; sw);
|
||||
|
test_group!(pairing_output; ark_ec::pairing::PairingOutput<MNT4_753>; msm);
|
||||
|
test_pairing!(pairing; crate::MNT4_753);
|
@ -1,12 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
generate_field_test!(mnt4_753; fq2; fq4; mont(12, 12); );
|
|
||||
generate_field_serialization_test!(mnt4_753;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
||||
|
test_field!(fq2; Fq2);
|
||||
|
test_field!(fq4; Fq4);
|
@ -1,15 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
curves::*, generate_bilinearity_test, generate_g1_test, generate_g2_test,
|
|
||||
generate_product_of_pairings_test, msm::*,
|
|
||||
};
|
|
||||
use ark_ec::{AffineRepr, PairingEngine, ProjectiveCurve};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::MulAssign;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
generate_g1_test!(mnt6_298; curve_tests; sw_tests;);
|
|
||||
generate_g2_test!(mnt6_298; curve_tests; sw_tests;);
|
|
||||
generate_bilinearity_test!(MNT6_298, Fq6);
|
|
||||
generate_product_of_pairings_test!(MNT6_298);
|
|
||||
|
test_group!(g1; G1Projective; sw);
|
||||
|
test_group!(g2; G2Projective; sw);
|
||||
|
test_group!(pairing_output; ark_ec::pairing::PairingOutput<MNT6_298>; msm);
|
||||
|
test_pairing!(pairing; crate::MNT6_298);
|
@ -1,15 +1,7 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
curves::*, generate_bilinearity_test, generate_g1_test, generate_g2_test,
|
|
||||
generate_product_of_pairings_test, msm::*,
|
|
||||
};
|
|
||||
use ark_ec::{AffineRepr, PairingEngine, ProjectiveCurve};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::MulAssign;
|
|
||||
|
|
||||
use crate::*;
|
use crate::*;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
generate_g1_test!(mnt6_753; curve_tests; sw_tests;);
|
|
||||
generate_g2_test!(mnt6_753; curve_tests; sw_tests;);
|
|
||||
generate_bilinearity_test!(MNT6_753, Fq6);
|
|
||||
generate_product_of_pairings_test!(MNT6_753);
|
|
||||
|
test_group!(g1; G1Projective; sw);
|
||||
|
test_group!(g2; G2Projective; sw);
|
||||
|
test_group!(pairing_output; ark_ec::pairing::PairingOutput<MNT6_753>; msm);
|
||||
|
test_pairing!(pairing; crate::MNT6_753);
|
@ -1,17 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::{curve_tests, sw_tests};
|
|
||||
use ark_ec::AffineRepr;
|
|
||||
|
use crate::Projective;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Affine, PallasParameters, Projective};
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<Projective>();
|
|
||||
sw_tests::<PallasParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = Affine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
test_group!(g1; Projective; sw);
|
@ -1,12 +1,5 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
use crate::{Fq, Fr};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Fq, FqConfig, Fr, FrConfig};
|
|
||||
|
|
||||
generate_field_test!(pallas; mont(4, 4); );
|
|
||||
generate_field_serialization_test!(pallas;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|
@ -1,17 +1,4 @@ |
|||||
use ark_algebra_test_templates::curves::{curve_tests, sw_tests};
|
|
||||
use ark_ec::AffineRepr;
|
|
||||
|
use crate::Projective;
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Affine, Projective, VestaParameters};
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_projective_curve() {
|
|
||||
curve_tests::<Projective>();
|
|
||||
sw_tests::<VestaParameters>();
|
|
||||
}
|
|
||||
|
|
||||
#[test]
|
|
||||
fn test_generator() {
|
|
||||
let generator = Affine::prime_subgroup_generator();
|
|
||||
assert!(generator.is_on_curve());
|
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
|
||||
}
|
|
||||
|
test_group!(g1; Projective; sw);
|
@ -1,12 +1,5 @@ |
|||||
use ark_algebra_test_templates::{
|
|
||||
fields::*, generate_field_serialization_test, generate_field_test,
|
|
||||
};
|
|
||||
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
|
|
||||
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
|
|
||||
use ark_std::{rand::Rng, test_rng};
|
|
||||
use core::ops::{AddAssign, MulAssign, SubAssign};
|
|
||||
|
use crate::{Fq, Fr};
|
||||
|
use ark_algebra_test_templates::*;
|
||||
|
|
||||
use crate::{Fq, FqConfig, Fr, FrConfig};
|
|
||||
|
|
||||
generate_field_test!(vesta; mont(4, 4); );
|
|
||||
generate_field_serialization_test!(vesta;);
|
|
||||
|
test_field!(fr; Fr; mont_prime_field);
|
||||
|
test_field!(fq; Fq; mont_prime_field);
|