halo2_axiom::fft::recursive

Trait CurveAffine

Source
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§

Source

type ScalarExt: WithSmallOrderMulGroup<3> + Ord

The scalar field of this elliptic curve.

Source

type Base: WithSmallOrderMulGroup<3> + Ord

The base field over which this elliptic curve is constructed.

Source

type CurveExt: CurveExt<AffineExt = Self, ScalarExt = Self::ScalarExt>

The projective form of the curve

Required Methods§

Source

fn coordinates(&self) -> CtOption<Coordinates<Self>>

Gets the coordinates of this point.

Returns None if this is the identity.

Source

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.

Source

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.

Source

fn a() -> Self::Base

Returns the curve constant $a$.

Source

fn b() -> Self::Base

Returns the curve constant $b$.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CurveAffine for G1Affine

Source§

type ScalarExt = Scalar

The scalar field of this elliptic curve.

Source§

type Base = Fp

The base field over which this elliptic curve is constructed.

Source§

type CurveExt = G1Projective

The projective form of the curve

Source§

fn coordinates(&self) -> CtOption<Coordinates<G1Affine>>

Gets the coordinates of this point.

Returns None if this is the identity.

Source§

fn from_xy( x: <G1Affine as CurveAffine>::Base, y: <G1Affine as CurveAffine>::Base, ) -> CtOption<G1Affine>

Obtains a point given $(x, y)$, failing if it is not on the curve.

Source§

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.

Source§

fn a() -> <G1Affine as CurveAffine>::Base

Returns the curve constant $a$.

Source§

fn b() -> <G1Affine as CurveAffine>::Base

Returns the curve constant $b$.

Source§

impl CurveAffine for G2Affine

Source§

type ScalarExt = Scalar

The scalar field of this elliptic curve.

Source§

type Base = Fp2

The base field over which this elliptic curve is constructed.

Source§

type CurveExt = G2Projective

The projective form of the curve

Source§

fn coordinates(&self) -> CtOption<Coordinates<G2Affine>>

Gets the coordinates of this point.

Returns None if this is the identity.

Source§

fn from_xy( x: <G2Affine as CurveAffine>::Base, y: <G2Affine as CurveAffine>::Base, ) -> CtOption<G2Affine>

Obtains a point given $(x, y)$, failing if it is not on the curve.

Source§

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.

Source§

fn a() -> <G2Affine as CurveAffine>::Base

Returns the curve constant $a$.

Source§

fn b() -> <G2Affine as CurveAffine>::Base

Returns the curve constant $b$.

Source§

impl CurveAffine for G1Affine

Source§

impl CurveAffine for G2Affine

Source§

impl CurveAffine for Ed25519Affine

Source§

impl CurveAffine for G1Affine

Source§

impl CurveAffine for ErisAffine

Source§

impl CurveAffine for G1Affine

Source§

impl CurveAffine for G2Affine

Source§

impl CurveAffine for Secp256k1Affine

Source§

impl CurveAffine for Secp256r1Affine

Source§

impl CurveAffine for Secq256k1Affine

Implementors§