@@ -3,10 +3,9 @@ use ark_ec::{
33 Affine as TEAffine , MontCurveConfig as MontgomeryModelParameter ,
44 Projective as TEProjective , TECurveConfig as TEModelParameters ,
55 } ,
6- AffineCurve , ProjectiveCurve ,
6+ AffineRepr , CurveGroup , Group ,
77} ;
88use ark_ff:: { BigInteger , BitIteratorBE , Field , One , PrimeField , Zero } ;
9-
109use ark_relations:: r1cs:: { ConstraintSystemRef , Namespace , SynthesisError } ;
1110
1211use crate :: { prelude:: * , ToConstraintFieldGadget , Vec } ;
@@ -85,7 +84,7 @@ mod montgomery_affine_impl {
8584 p : & TEAffine < P > ,
8685 ) -> Result < ( P :: BaseField , P :: BaseField ) , SynthesisError > {
8786 let montgomery_point: GroupAffine < P > = if p. y == P :: BaseField :: one ( ) {
88- GroupAffine :: zero ( )
87+ GroupAffine :: identity ( )
8988 } else if p. x == P :: BaseField :: zero ( ) {
9089 GroupAffine :: new ( P :: BaseField :: zero ( ) , P :: BaseField :: zero ( ) )
9190 } else {
@@ -543,7 +542,7 @@ where
543542 if bits. len ( ) == 2 {
544543 let mut table = [ multiples[ 0 ] , multiples[ 1 ] , multiples[ 0 ] + multiples[ 1 ] ] ;
545544
546- TEProjective :: batch_normalization ( & mut table) ;
545+ TEProjective :: normalize_batch ( & mut table) ;
547546 let x_s = [ zero. x , table[ 0 ] . x , table[ 1 ] . x , table[ 2 ] . x ] ;
548547 let y_s = [ zero. y , table[ 0 ] . y , table[ 1 ] . y , table[ 2 ] . y ] ;
549548
@@ -675,7 +674,11 @@ where
675674 f : impl FnOnce ( ) -> Result < Point , SynthesisError > ,
676675 mode : AllocationMode ,
677676 ) -> Result < Self , SynthesisError > {
678- Self :: new_variable ( cs, || f ( ) . map ( |b| b. borrow ( ) . into_projective ( ) ) , mode)
677+ Self :: new_variable (
678+ cs,
679+ || f ( ) . map ( |b| TEProjective :: < P > :: from ( ( * b. borrow ( ) ) . clone ( ) ) ) ,
680+ mode,
681+ )
679682 }
680683}
681684
0 commit comments