From a06ba42fe67eb97c382c64ea2e48f51dfef5c35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Wed, 28 Feb 2024 16:58:17 -0500 Subject: [PATCH] refactor: simplify AllocatedPointNonInfinity::to_allocated_point --- src/gadgets/ecc.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gadgets/ecc.rs b/src/gadgets/ecc.rs index 7831329b3..136d01bdd 100644 --- a/src/gadgets/ecc.rs +++ b/src/gadgets/ecc.rs @@ -491,7 +491,7 @@ impl AllocatedPoint { // convert back to AllocatedPoint let res = { // we set acc.is_infinity = self.is_infinity - let acc = acc.to_allocated_point(&self.is_infinity)?; + let acc = acc.to_allocated_point(&self.is_infinity); // we remove the initial slack if bits[0] is as not as assumed (i.e., it is not 1) let acc_minus_initial = { @@ -530,7 +530,7 @@ impl AllocatedPoint { y, is_infinity: res.is_infinity, }; - let mut p_complete = p.to_allocated_point(&self.is_infinity)?; + let mut p_complete = p.to_allocated_point(&self.is_infinity); for (i, bit) in complete_bits.iter().enumerate() { let temp = acc.add(cs.namespace(|| format!("add_complete {i}")), &p_complete)?; @@ -630,12 +630,12 @@ impl AllocatedPointNonInfinity { pub fn to_allocated_point( &self, is_infinity: &AllocatedNum, - ) -> Result, SynthesisError> { - Ok(AllocatedPoint { + ) -> AllocatedPoint { + AllocatedPoint { x: self.x.clone(), y: self.y.clone(), is_infinity: is_infinity.clone(), - }) + } } /// Returns coordinates associated with the point.