Trait pairing_ce::CurveAffine[][src]

pub trait CurveAffine: Copy + Clone + Sized + Send + Sync + Debug + Display + PartialEq + Eq + 'static {
    type Engine: Engine<Fr = Self::Scalar>;
    type Scalar: PrimeField + SqrtField;
    type Base: SqrtField;
    type Projective: CurveProjective<Affine = Self, Scalar = Self::Scalar>;
    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 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; fn into_compressed(&self) -> Self::Compressed { ... }
fn into_uncompressed(&self) -> Self::Uncompressed { ... }
}

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

Associated Types

type Engine: Engine<Fr = Self::Scalar>[src]

type Scalar: PrimeField + SqrtField[src]

type Base: SqrtField[src]

type Projective: CurveProjective<Affine = Self, Scalar = Self::Scalar>[src]

type Prepared: Clone + Send + Sync + 'static[src]

type Uncompressed: EncodedPoint<Affine = Self>[src]

type Compressed: EncodedPoint<Affine = Self>[src]

type Pair: CurveAffine<Pair = Self>[src]

type PairingResult: Field[src]

Loading content...

Required methods

fn zero() -> Self[src]

Returns the additive identity.

fn one() -> Self[src]

Returns a fixed generator of unknown exponent.

fn is_zero(&self) -> bool[src]

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

fn negate(&mut self)[src]

Negates this element.

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

Performs scalar multiplication of this element with mixed addition.

fn prepare(&self) -> Self::Prepared[src]

Prepares this element for pairing purposes.

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

Perform a pairing

fn into_projective(&self) -> Self::Projective[src]

Converts this element into its affine representation.

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

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

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

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

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

fn a_coeff() -> Self::Base[src]

returns A coefficient for a short Weierstrass form

fn b_coeff() -> Self::Base[src]

returns B coefficient for a short Weierstrass form

Loading content...

Provided methods

fn into_compressed(&self) -> Self::Compressed[src]

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

fn into_uncompressed(&self) -> Self::Uncompressed[src]

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

Loading content...

Implementors

impl CurveAffine for pairing_ce::bls12_381::G1Affine[src]

type Engine = Bls12

type Scalar = Fr

type Base = Fq

type Prepared = G1Prepared

type Projective = G1

type Uncompressed = G1Uncompressed

type Compressed = G1Compressed

type Pair = G2Affine

type PairingResult = Fq12

fn zero() -> Self[src]

fn one() -> Self[src]

fn is_zero(&self) -> bool[src]

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G1[src]

fn negate(&mut self)[src]

fn prepare(&self) -> Self::Prepared[src]

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

fn into_projective(&self) -> G1[src]

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

fn a_coeff() -> Self::Base[src]

fn b_coeff() -> Self::Base[src]

impl CurveAffine for pairing_ce::bls12_381::G2Affine[src]

type Engine = Bls12

type Scalar = Fr

type Base = Fq2

type Prepared = G2Prepared

type Projective = G2

type Uncompressed = G2Uncompressed

type Compressed = G2Compressed

type Pair = G1Affine

type PairingResult = Fq12

fn zero() -> Self[src]

fn one() -> Self[src]

fn is_zero(&self) -> bool[src]

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G2[src]

fn negate(&mut self)[src]

fn prepare(&self) -> Self::Prepared[src]

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

fn into_projective(&self) -> G2[src]

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

fn a_coeff() -> Self::Base[src]

fn b_coeff() -> Self::Base[src]

impl CurveAffine for pairing_ce::bn256::G1Affine[src]

type Engine = Bn256

type Scalar = Fr

type Base = Fq

type Prepared = G1Prepared

type Projective = G1

type Uncompressed = G1Uncompressed

type Compressed = G1Compressed

type Pair = G2Affine

type PairingResult = Fq12

fn zero() -> Self[src]

fn one() -> Self[src]

fn is_zero(&self) -> bool[src]

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G1[src]

fn negate(&mut self)[src]

fn prepare(&self) -> Self::Prepared[src]

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

fn into_projective(&self) -> G1[src]

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

fn a_coeff() -> Self::Base[src]

fn b_coeff() -> Self::Base[src]

impl CurveAffine for pairing_ce::bn256::G2Affine[src]

type Engine = Bn256

type Scalar = Fr

type Base = Fq2

type Prepared = G2Prepared

type Projective = G2

type Uncompressed = G2Uncompressed

type Compressed = G2Compressed

type Pair = G1Affine

type PairingResult = Fq12

fn zero() -> Self[src]

fn one() -> Self[src]

fn is_zero(&self) -> bool[src]

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G2[src]

fn negate(&mut self)[src]

fn prepare(&self) -> Self::Prepared[src]

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

fn into_projective(&self) -> G2[src]

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

fn a_coeff() -> Self::Base[src]

fn b_coeff() -> Self::Base[src]

impl CurveAffine for pairing_ce::compact_bn256::G1Affine[src]

type Engine = Bn256

type Scalar = Fr

type Base = Fq

type Prepared = G1Prepared

type Projective = G1

type Uncompressed = G1Uncompressed

type Compressed = G1Compressed

type Pair = G2Affine

type PairingResult = Fq12

fn zero() -> Self[src]

fn one() -> Self[src]

fn is_zero(&self) -> bool[src]

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G1[src]

fn negate(&mut self)[src]

fn prepare(&self) -> Self::Prepared[src]

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

fn into_projective(&self) -> G1[src]

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

fn a_coeff() -> Self::Base[src]

fn b_coeff() -> Self::Base[src]

impl CurveAffine for pairing_ce::compact_bn256::G2Affine[src]

type Engine = Bn256

type Scalar = Fr

type Base = Fq2

type Prepared = G2Prepared

type Projective = G2

type Uncompressed = G2Uncompressed

type Compressed = G2Compressed

type Pair = G1Affine

type PairingResult = Fq12

fn zero() -> Self[src]

fn one() -> Self[src]

fn is_zero(&self) -> bool[src]

fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(&self, by: S) -> G2[src]

fn negate(&mut self)[src]

fn prepare(&self) -> Self::Prepared[src]

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

fn into_projective(&self) -> G2[src]

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

fn into_xy_unchecked(self) -> (Self::Base, Self::Base)[src]

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

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

fn a_coeff() -> Self::Base[src]

fn b_coeff() -> Self::Base[src]

Loading content...