Trait halo2_proofs::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§

type ScalarExt: WithSmallOrderMulGroup<3> + Ord

The scalar field of this elliptic curve.

type Base: WithSmallOrderMulGroup<3> + Ord

The base field over which this elliptic curve is constructed.

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

The projective form of the curve

Required Methods§

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>

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

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.

fn a() -> Self::Base

Returns the curve constant $a$.

fn b() -> Self::Base

Returns the curve constant $b$.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl CurveAffine for ErisAffine

§

type ScalarExt = Fp

§

type Base = Fq

§

type CurveExt = Eris

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G1Affine

§

type ScalarExt = Fq

§

type Base = Fr

§

type CurveExt = G1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G1Affine

§

type ScalarExt = Fr

§

type Base = Fq

§

type CurveExt = G1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G1Affine

§

type ScalarExt = Fr

§

type Base = Fq

§

type CurveExt = G1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G1Affine

§

type ScalarExt = Fq

§

type Base = Fp

§

type CurveExt = G1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G2Affine

§

type ScalarExt = Fq

§

type Base = QuadExtField<Fp>

§

type CurveExt = G2

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G2Affine

§

type ScalarExt = Fr

§

type Base = QuadExtField<Fq>

§

type CurveExt = G2

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for G2Affine

§

type ScalarExt = Fr

§

type Base = QuadExtField<Fq>

§

type CurveExt = G2

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for Secp256k1Affine

§

type ScalarExt = Fq

§

type Base = Fp

§

type CurveExt = Secp256k1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for Secp256r1Affine

§

type ScalarExt = Fq

§

type Base = Fp

§

type CurveExt = Secp256r1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

§

impl CurveAffine for Secq256k1Affine

§

type ScalarExt = Fp

§

type Base = Fq

§

type CurveExt = Secq256k1

§

fn is_on_curve(&self) -> Choice

§

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

§

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

§

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

§

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

Implementors§

§

impl CurveAffine for EpAffine

§

type ScalarExt = Fq

§

type Base = Fp

§

type CurveExt = Ep

§

impl CurveAffine for EqAffine

§

type ScalarExt = Fp

§

type Base = Fq

§

type CurveExt = Eq