From 56c07bad570a129d25b010d239b4de793d085328 Mon Sep 17 00:00:00 2001 From: David Nevado Date: Wed, 21 Feb 2024 19:00:45 +0100 Subject: [PATCH] fix: update new_impl_curve calls --- src/bn256/curve.rs | 5 +++-- src/grumpkin/curve.rs | 3 ++- src/pluto_eris/curve.rs | 7 ++++--- src/secp256k1/curve.rs | 5 +++-- src/secp256r1/curve.rs | 3 ++- src/secq256k1/curve.rs | 3 ++- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/bn256/curve.rs b/src/bn256/curve.rs index 4549183b..7787223f 100644 --- a/src/bn256/curve.rs +++ b/src/bn256/curve.rs @@ -5,6 +5,7 @@ use crate::arithmetic::EndoParameters; use crate::bn256::Fq; use crate::bn256::Fq2; use crate::bn256::Fr; +use crate::derive::curve::{IS_IDENTITY_MASK, IS_IDENTITY_SHIFT, NEG_Y_MASK, NEG_Y_SHIFT}; use crate::endo; use crate::ff::WithSmallOrderMulGroup; use crate::ff::{Field, PrimeField}; @@ -32,7 +33,7 @@ new_curve_impl!( (pub), G1, G1Affine, - false, + 2, Fq, Fr, (G1_GENERATOR_X,G1_GENERATOR_Y), @@ -46,7 +47,7 @@ new_curve_impl!( (pub), G2, G2Affine, - false, + 2, Fq2, Fr, (G2_GENERATOR_X, G2_GENERATOR_Y), diff --git a/src/grumpkin/curve.rs b/src/grumpkin/curve.rs index f0ddf86a..aa9e40ac 100644 --- a/src/grumpkin/curve.rs +++ b/src/grumpkin/curve.rs @@ -2,6 +2,7 @@ use crate::arithmetic::mul_512; use crate::arithmetic::sbb; use crate::arithmetic::CurveEndo; use crate::arithmetic::EndoParameters; +use crate::derive::curve::{IS_IDENTITY_MASK, IS_IDENTITY_SHIFT, NEG_Y_MASK, NEG_Y_SHIFT}; use crate::ff::WithSmallOrderMulGroup; use crate::ff::{Field, PrimeField}; use crate::group::Curve; @@ -29,7 +30,7 @@ new_curve_impl!( (pub), G1, G1Affine, - false, + 2, Fq, Fr, (G1_GENERATOR_X, G1_GENERATOR_Y), diff --git a/src/pluto_eris/curve.rs b/src/pluto_eris/curve.rs index 9b86c69c..43622ccf 100644 --- a/src/pluto_eris/curve.rs +++ b/src/pluto_eris/curve.rs @@ -1,4 +1,5 @@ use super::fields::{fp::Fp, fp2::Fp2, fq::Fq}; +use crate::derive::curve::{IS_IDENTITY_MASK, IS_IDENTITY_SHIFT, NEG_Y_MASK, NEG_Y_SHIFT}; use crate::ff::WithSmallOrderMulGroup; use crate::ff::{Field, PrimeField}; use crate::group::{prime::PrimeCurveAffine, Curve, Group as _, GroupEncoding}; @@ -124,7 +125,7 @@ new_curve_impl!( (pub), G1, G1Affine, - false, + 2, Fp, Fq, (G1_GENERATOR_X,G1_GENERATOR_Y), @@ -160,7 +161,7 @@ new_curve_impl!( (pub), Eris, ErisAffine, - false, + 2, Fq, Fp, (ERIS_GENERATOR_X,ERIS_GENERATOR_Y), @@ -232,7 +233,7 @@ new_curve_impl!( (pub), G2, G2Affine, - false, + 2, Fp2, Fq, (G2_GENERATOR_X,G2_GENERATOR_Y), diff --git a/src/secp256k1/curve.rs b/src/secp256k1/curve.rs index a8bf5bca..bc5b26c7 100644 --- a/src/secp256k1/curve.rs +++ b/src/secp256k1/curve.rs @@ -1,3 +1,4 @@ +use crate::derive::curve::{IS_IDENTITY_MASK, IS_IDENTITY_SHIFT, NEG_Y_MASK, NEG_Y_SHIFT}; use crate::ff::WithSmallOrderMulGroup; use crate::ff::{Field, PrimeField}; use crate::group::{prime::PrimeCurveAffine, Curve, Group as _, GroupEncoding}; @@ -58,7 +59,7 @@ new_curve_impl!( (pub), Secp256k1, Secp256k1Affine, - true, + 0, Fp, Fq, (SECP_GENERATOR_X,SECP_GENERATOR_Y), @@ -127,7 +128,7 @@ new_curve_impl!( (pub(crate)), IsoSecp256k1, IsoSecp256k1Affine, - true, + 0, Fp, Fq, (ISO_SECP_GENERATOR_X, ISO_SECP_GENERATOR_Y), diff --git a/src/secp256r1/curve.rs b/src/secp256r1/curve.rs index fbd1c538..210ad5c2 100644 --- a/src/secp256r1/curve.rs +++ b/src/secp256r1/curve.rs @@ -1,3 +1,4 @@ +use crate::derive::curve::{IS_IDENTITY_MASK, IS_IDENTITY_SHIFT, NEG_Y_MASK, NEG_Y_SHIFT}; use crate::ff::WithSmallOrderMulGroup; use crate::ff::{Field, PrimeField}; use crate::group::{prime::PrimeCurveAffine, Curve, Group as _, GroupEncoding}; @@ -69,7 +70,7 @@ new_curve_impl!( (pub), Secp256r1, Secp256r1Affine, - true, + 0, Fp, Fq, (SECP_GENERATOR_X,SECP_GENERATOR_Y), diff --git a/src/secq256k1/curve.rs b/src/secq256k1/curve.rs index 726eae8a..221c997f 100644 --- a/src/secq256k1/curve.rs +++ b/src/secq256k1/curve.rs @@ -1,3 +1,4 @@ +use crate::derive::curve::{IS_IDENTITY_MASK, IS_IDENTITY_SHIFT, NEG_Y_MASK, NEG_Y_SHIFT}; use crate::ff::WithSmallOrderMulGroup; use crate::ff::{Field, PrimeField}; use crate::group::Curve; @@ -41,7 +42,7 @@ new_curve_impl!( (pub), Secq256k1, Secq256k1Affine, - true, + 0, Fq, Fp, (SECQ_GENERATOR_X, SECQ_GENERATOR_Y),