Trait halo2_backend::arithmetic::CurveAffine
pub trait CurveAffine: PrimeCurveAffine<Scalar = Self::ScalarExt, Curve = Self::CurveExt> + Default + Add<Output = Self::Curve> + Sub<Output = Self::Curve> + ConditionallySelectable + ConstantTimeEq + From<Self::Curve> {
type ScalarExt: WithSmallOrderMulGroup<3> + Ord;
type Base: WithSmallOrderMulGroup<3> + Ord;
type CurveExt: CurveExt<AffineExt = Self, ScalarExt = Self::ScalarExt>;
// Required methods
fn coordinates(&self) -> CtOption<Coordinates<Self>>;
fn from_xy(x: Self::Base, y: Self::Base) -> CtOption<Self>;
fn is_on_curve(&self) -> Choice;
fn a() -> Self::Base;
fn b() -> Self::Base;
}
Expand description
This trait is the affine counterpart to Curve
and is used for
serialization, storage in memory, and inspection of $x$ and $y$ coordinates.
Requires the alloc
feature flag because of hash_to_curve
on CurveExt
.
Required Associated Types§
Required Methods§
fn coordinates(&self) -> CtOption<Coordinates<Self>>
fn coordinates(&self) -> CtOption<Coordinates<Self>>
Gets the coordinates of this point.
Returns None if this is the identity.
fn from_xy(x: Self::Base, y: Self::Base) -> CtOption<Self>
fn from_xy(x: Self::Base, y: Self::Base) -> CtOption<Self>
Obtains a point given $(x, y)$, failing if it is not on the curve.
fn is_on_curve(&self) -> Choice
fn is_on_curve(&self) -> Choice
Returns whether or not this element is on the curve; should always be true unless an “unchecked” API was used.
Object Safety§
This trait is not object safe.