From f2e53be88e886dd4c6188bf4fe847f57276a9216 Mon Sep 17 00:00:00 2001 From: Weikeng Chen Date: Sat, 3 Sep 2022 21:22:22 -0700 Subject: [PATCH] Montgomery cannot use TE affine as intermediate representations (#103) * debug * test * use mont * reduce the delta Co-authored-by: onewayfunc --- src/groups/curves/twisted_edwards/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/groups/curves/twisted_edwards/mod.rs b/src/groups/curves/twisted_edwards/mod.rs index f7dbd93..789cb59 100644 --- a/src/groups/curves/twisted_edwards/mod.rs +++ b/src/groups/curves/twisted_edwards/mod.rs @@ -38,7 +38,7 @@ pub struct MontgomeryAffineVar< mod montgomery_affine_impl { use super::*; - use ark_ec::twisted_edwards::Affine as GroupAffine; + use ark_ec::twisted_edwards::MontgomeryAffine as GroupAffine; use ark_ff::Field; use core::ops::Add; @@ -83,8 +83,8 @@ mod montgomery_affine_impl { pub fn from_edwards_to_coords( p: &TEAffine

, ) -> Result<(P::BaseField, P::BaseField), SynthesisError> { - let montgomery_point: GroupAffine

= if p.y == P::BaseField::one() { - GroupAffine::identity() + let montgomery_point: GroupAffine = if p.y == P::BaseField::one() { + return Err(SynthesisError::UnexpectedIdentity); } else if p.x == P::BaseField::zero() { GroupAffine::new(P::BaseField::zero(), P::BaseField::zero()) } else {