Browse Source

Montgomery cannot use TE affine as intermediate representations (#103)

* debug

* test

* use mont

* reduce the delta

Co-authored-by: onewayfunc <onewayfunc@gmail.com>
master
Weikeng Chen 2 years ago
committed by GitHub
parent
commit
f2e53be88e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/groups/curves/twisted_edwards/mod.rs

+ 3
- 3
src/groups/curves/twisted_edwards/mod.rs

@ -38,7 +38,7 @@ pub struct MontgomeryAffineVar<
mod montgomery_affine_impl { mod montgomery_affine_impl {
use super::*; use super::*;
use ark_ec::twisted_edwards::Affine as GroupAffine;
use ark_ec::twisted_edwards::MontgomeryAffine as GroupAffine;
use ark_ff::Field; use ark_ff::Field;
use core::ops::Add; use core::ops::Add;
@ -83,8 +83,8 @@ mod montgomery_affine_impl {
pub fn from_edwards_to_coords( pub fn from_edwards_to_coords(
p: &TEAffine<P>, p: &TEAffine<P>,
) -> Result<(P::BaseField, P::BaseField), SynthesisError> { ) -> Result<(P::BaseField, P::BaseField), SynthesisError> {
let montgomery_point: GroupAffine<P> = if p.y == P::BaseField::one() {
GroupAffine::identity()
let montgomery_point: GroupAffine<P::MontCurveConfig> = if p.y == P::BaseField::one() {
return Err(SynthesisError::UnexpectedIdentity);
} else if p.x == P::BaseField::zero() { } else if p.x == P::BaseField::zero() {
GroupAffine::new(P::BaseField::zero(), P::BaseField::zero()) GroupAffine::new(P::BaseField::zero(), P::BaseField::zero())
} else { } else {

Loading…
Cancel
Save