diff --git a/src/circuit/gadget/ecc.rs b/src/circuit/gadget/ecc.rs index 22a42411..39a0e66d 100644 --- a/src/circuit/gadget/ecc.rs +++ b/src/circuit/gadget/ecc.rs @@ -1,6 +1,5 @@ //! Gadgets for elliptic curve operations. -use std::convert::{TryFrom, TryInto}; use std::fmt::Debug; use halo2::{ @@ -38,7 +37,7 @@ pub trait EccInstructions: Chip + UtilitiesInstructions /// Variable representing an elliptic curve point. type Point: From + IsIdentity + Clone + Debug; /// Variable representing a non-identity elliptic curve point. - type NonIdentityPoint: TryFrom + Clone + Debug; + type NonIdentityPoint: Clone + Debug; /// Variable representing the affine short Weierstrass x-coordinate of an /// elliptic curve point. type X: Clone + Debug; @@ -283,24 +282,6 @@ impl + Clone + Debug + Eq> } } -impl + Clone + Debug + Eq> TryFrom> - for NonIdentityPoint -{ - type Error = Error; - - fn try_from(point: Point) -> Result { - point - .inner - .clone() - .try_into() - .map(|inner| Self { - chip: point.chip, - inner, - }) - .map_err(|_| Error::SynthesisError) - } -} - /// An elliptic curve point over the given curve. #[derive(Copy, Clone, Debug)] pub struct Point + Clone + Debug + Eq> { diff --git a/src/circuit/gadget/ecc/chip.rs b/src/circuit/gadget/ecc/chip.rs index ae9e4053..71a69507 100644 --- a/src/circuit/gadget/ecc/chip.rs +++ b/src/circuit/gadget/ecc/chip.rs @@ -1,5 +1,3 @@ -use std::convert::TryFrom; - use super::{EccInstructions, IsIdentity}; use crate::{ circuit::gadget::utilities::{ @@ -129,20 +127,6 @@ impl From for EccPoint { } } -impl TryFrom for NonIdentityEccPoint { - type Error = Error; - - fn try_from(point: EccPoint) -> Result { - if point.is_identity() == Some(true) { - return Err(Error::SynthesisError); - } - Ok(NonIdentityEccPoint { - x: point.x, - y: point.y, - }) - } -} - /// Configuration for the ECC chip #[derive(Clone, Debug, Eq, PartialEq)] #[allow(non_snake_case)]