mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-09 07:21:30 +01:00
Fix benchmarks and fix accidental renaming of Pallas/Vesta (#108)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use ark_ec::{
|
||||
models::CurveConfig,
|
||||
short_weierstrass::{Affine, Projective, SWCurveConfig},
|
||||
short_weierstrass::{self as sw, SWCurveConfig},
|
||||
};
|
||||
use ark_ff::{Field, MontFp, Zero};
|
||||
|
||||
@@ -23,8 +23,8 @@ impl CurveConfig for PallasParameters {
|
||||
const COFACTOR_INV: Fr = Fr::ONE;
|
||||
}
|
||||
|
||||
pub type G1Affine = Affine<PallasParameters>;
|
||||
pub type G1Projective = Projective<PallasParameters>;
|
||||
pub type Affine = sw::Affine<PallasParameters>;
|
||||
pub type Projective = sw::Projective<PallasParameters>;
|
||||
|
||||
impl SWCurveConfig for PallasParameters {
|
||||
/// COEFF_A = 0
|
||||
@@ -34,7 +34,7 @@ impl SWCurveConfig for PallasParameters {
|
||||
const COEFF_B: Fq = MontFp!("5");
|
||||
|
||||
/// AFFINE_GENERATOR_COEFFS = (G1_GENERATOR_X, G1_GENERATOR_Y)
|
||||
const GENERATOR: G1Affine = Affine::new_unchecked(G_GENERATOR_X, G_GENERATOR_Y);
|
||||
const GENERATOR: Affine = Affine::new_unchecked(G_GENERATOR_X, G_GENERATOR_Y);
|
||||
|
||||
#[inline(always)]
|
||||
fn mul_by_a(_: &Self::BaseField) -> Self::BaseField {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
use ark_algebra_test_templates::curves::{curve_tests, sw_tests};
|
||||
use ark_ec::AffineCurve;
|
||||
|
||||
use crate::{G1Affine, G1Projective, PallasParameters};
|
||||
use crate::{Affine, PallasParameters, Projective};
|
||||
|
||||
#[test]
|
||||
fn test_projective_curve() {
|
||||
curve_tests::<G1Projective>();
|
||||
curve_tests::<Projective>();
|
||||
sw_tests::<PallasParameters>();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_generator() {
|
||||
let generator = G1Affine::prime_subgroup_generator();
|
||||
let generator = Affine::prime_subgroup_generator();
|
||||
assert!(generator.is_on_curve());
|
||||
assert!(generator.is_in_correct_subgroup_assuming_on_curve());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user