zksync_pairing

Trait CurveAffine

Source
pub trait CurveAffine:
    Copy
    + Clone
    + Sized
    + Send
    + Sync
    + Debug
    + Display
    + PartialEq
    + Eq
    + 'static
    + Serialize
    + DeserializeOwned {
    type Engine: Engine<Fr = Self::Scalar>;
    type Scalar: PrimeField + SqrtField;
    type Base: SqrtField;
    type Projective: CurveProjective<Affine = Self, Scalar = Self::Scalar, Base = Self::Base>;
    type Prepared: Clone + Send + Sync + 'static;
    type Uncompressed: EncodedPoint<Affine = Self>;
    type Compressed: EncodedPoint<Affine = Self>;
    type Pair: CurveAffine<Pair = Self>;
    type PairingResult: Field;

Show 16 methods // Required methods fn zero() -> Self; fn one() -> Self; fn is_zero(&self) -> bool; fn negate(&mut self); fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, ) -> Self::Projective; fn prepare(&self) -> Self::Prepared; fn pairing_with(&self, other: &Self::Pair) -> Self::PairingResult; fn into_projective(&self) -> Self::Projective; fn as_xy(&self) -> (&Self::Base, &Self::Base); fn into_xy_unchecked(self) -> (Self::Base, Self::Base); fn from_xy_unchecked(x: Self::Base, y: Self::Base) -> Self; fn from_xy_checked( x: Self::Base, y: Self::Base, ) -> Result<Self, GroupDecodingError>; fn a_coeff() -> Self::Base; fn b_coeff() -> Self::Base; // Provided methods fn into_compressed(&self) -> Self::Compressed { ... } fn into_uncompressed(&self) -> Self::Uncompressed { ... }
}
Expand description

Affine representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.

Required Associated Types§

Source

type Engine: Engine<Fr = Self::Scalar>

Source

type Scalar: PrimeField + SqrtField

Source

type Base: SqrtField

Source

type Projective: CurveProjective<Affine = Self, Scalar = Self::Scalar, Base = Self::Base>

Source

type Prepared: Clone + Send + Sync + 'static

Source

type Uncompressed: EncodedPoint<Affine = Self>

Source

type Compressed: EncodedPoint<Affine = Self>

Source

type Pair: CurveAffine<Pair = Self>

Source

type PairingResult: Field

Required Methods§

Source

fn zero() -> Self

Returns the additive identity.

Source

fn one() -> Self

Returns a fixed generator of unknown exponent.

Source

fn is_zero(&self) -> bool

Determines if this point represents the point at infinity; the additive identity.

Source

fn negate(&mut self)

Negates this element.

Source

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, ) -> Self::Projective

Performs scalar multiplication of this element with mixed addition.

Source

fn prepare(&self) -> Self::Prepared

Prepares this element for pairing purposes.

Source

fn pairing_with(&self, other: &Self::Pair) -> Self::PairingResult

Perform a pairing

Source

fn into_projective(&self) -> Self::Projective

Converts this element into its affine representation.

Source

fn as_xy(&self) -> (&Self::Base, &Self::Base)

Returns references to underlying X and Y coordinates. Users should check for infinity outside of this call

Source

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)

Returns underlying X and Y coordinates. Users should check for infinity outside of this call

Source

fn from_xy_unchecked(x: Self::Base, y: Self::Base) -> Self

Creates a point from raw X and Y coordinates. Point of infinity is encoded as (0,0) by default. On-curve check is NOT performed

Source

fn from_xy_checked( x: Self::Base, y: Self::Base, ) -> Result<Self, GroupDecodingError>

Creates a point from raw X and Y coordinates. Point of infinity is encoded as (0,0) by default. On-curve check is performed

Source

fn a_coeff() -> Self::Base

returns A coefficient for a short Weierstrass form

Source

fn b_coeff() -> Self::Base

returns B coefficient for a short Weierstrass form

Provided Methods§

Source

fn into_compressed(&self) -> Self::Compressed

Converts this element into its compressed encoding, so long as it’s not the point at infinity.

Source

fn into_uncompressed(&self) -> Self::Uncompressed

Converts this element into its uncompressed encoding, so long as it’s not the point at infinity.

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.

Implementors§

Source§

impl CurveAffine for zksync_pairing::bls12_381::G1Affine

Source§

impl CurveAffine for zksync_pairing::bls12_381::G2Affine

Source§

impl CurveAffine for zksync_pairing::bn256::G1Affine

Source§

impl CurveAffine for zksync_pairing::bn256::G2Affine

Source§

impl CurveAffine for zksync_pairing::compact_bn256::G1Affine

Source§

impl CurveAffine for zksync_pairing::compact_bn256::G2Affine