[−][src]Trait pairing_plus::CurveAffine
Affine representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.
Associated Types
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
Required methods
fn zero() -> Self
Returns the additive identity.
fn one() -> Self
Returns a fixed generator of unknown exponent.
fn is_zero(&self) -> bool
Determines if this point represents the point at infinity; the additive identity.
fn negate(&mut self)
Negates this element.
fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S
) -> Self::Projective
&self,
other: S
) -> Self::Projective
Performs scalar multiplication of this element with mixed addition.
fn prepare(&self) -> Self::Prepared
Prepares this element for pairing purposes.
fn pairing_with(&self, other: &Self::Pair) -> Self::PairingResult
Perform a pairing
fn into_projective(&self) -> Self::Projective
Converts this element into its affine representation.
fn as_tuple(&self) -> (&Self::Base, &Self::Base)
Borrow references to the X and Y coordinates of this point.
unsafe fn as_tuple_mut(&mut self) -> (&mut Self::Base, &mut Self::Base)
Borrow mutable references to the X and Y coordinates of this point. Unsafe, because incorrectly modifying the coordinates violates the guarantee that the point must be on the curve and in the correct subgroup.
fn sum_of_products(bases: &[Self], scalars: &[&[u64; 4]]) -> Self::Projective
given x, compute x^3+b multiplication of many points compute s1 * p1 + ... + sn * pn simultaneously
fn find_pippinger_window(num_components: usize) -> usize
Find the optimal window for running Pippinger's algorithm; preprogrammed values
fn find_pippinger_window_via_estimate(num_components: usize) -> usize
Find the optimal window for running Pippinger's algorithm; computed values via an estimate of running time
fn sum_of_products_pippinger(
bases: &[Self],
scalars: &[&[u64; 4]],
window: usize
) -> Self::Projective
bases: &[Self],
scalars: &[&[u64; 4]],
window: usize
) -> Self::Projective
multiplication of many points with Pippinger's algorithm of window size w compute s1 * p1 + ... + sn * pn simultaneously
fn sum_of_products_precomp_256(
bases: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self]
) -> Self::Projective
bases: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self]
) -> Self::Projective
multiplication of many points with precompuation compute s1 * p1 + ... + sn * pn simultaneously assuming pre[j*256+i] = (\sum_{b such that bth bit of i is 1} 2^{32i}) * bases[j] for each j and i in 0..256
fn precomp_3(&self, pre: &mut [Self])
pre[0] becomes (2^64) * self, pre[1] becomes (2^128) * self, and pre[2] (becomes 2^196) * self
fn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self]
) -> Self::Projective
&self,
other: S,
pre: &[Self]
) -> Self::Projective
Performs scalar multiplication of this element, assuming pre = [(2^64)*self, (2^128)*self, (2^192)*self]
fn precomp_256(&self, pre: &mut [Self])
pre[i] becomes (\sum_{b such that bth bit of i is 1} 2^{32i}) * self for i in 0..25
fn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self]
) -> Self::Projective
&self,
other: S,
pre: &[Self]
) -> Self::Projective
Performs scalar multiplication of this element, assuming pre[i] = (\sum_{b such that bth bit of i is 1} 2^{32i}) * self for i in 0..256
Provided methods
fn into_compressed(&self) -> Self::Compressed
Converts this element into its compressed encoding, so long as it's not the point at infinity.
fn into_uncompressed(&self) -> Self::Uncompressed
Converts this element into its uncompressed encoding, so long as it's not the point at infinity.
Implementors
impl CurveAffine for 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_tuple(&self) -> (&Fq, &Fq)
[src]
unsafe fn as_tuple_mut(&mut self) -> (&mut Fq, &mut Fq)
[src]
fn precomp_3(&self, pre: &mut [Self])
[src]
fn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self]
) -> G1
[src]
&self,
other: S,
pre: &[Self]
) -> G1
fn precomp_256(&self, pre: &mut [Self])
[src]
fn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self]
) -> G1
[src]
&self,
other: S,
pre: &[Self]
) -> G1
fn sum_of_products(points: &[Self], scalars: &[&[u64; 4]]) -> G1
[src]
fn find_pippinger_window(num_components: usize) -> usize
[src]
fn find_pippinger_window_via_estimate(num_components: usize) -> usize
[src]
fn sum_of_products_pippinger(
points: &[Self],
scalars: &[&[u64; 4]],
window: usize
) -> G1
[src]
points: &[Self],
scalars: &[&[u64; 4]],
window: usize
) -> G1
fn sum_of_products_precomp_256(
points: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self]
) -> G1
[src]
points: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self]
) -> G1
impl CurveAffine for 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_tuple(&self) -> (&Fq2, &Fq2)
[src]
unsafe fn as_tuple_mut(&mut self) -> (&mut Fq2, &mut Fq2)
[src]
fn precomp_3(&self, pre: &mut [Self])
[src]
fn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self]
) -> G2
[src]
&self,
other: S,
pre: &[Self]
) -> G2
fn precomp_256(&self, pre: &mut [Self])
[src]
fn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self]
) -> G2
[src]
&self,
other: S,
pre: &[Self]
) -> G2
fn sum_of_products(points: &[Self], scalars: &[&[u64; 4]]) -> G2
[src]
fn find_pippinger_window(num_components: usize) -> usize
[src]
fn find_pippinger_window_via_estimate(num_components: usize) -> usize
[src]
fn sum_of_products_pippinger(
points: &[Self],
scalars: &[&[u64; 4]],
window: usize
) -> G2
[src]
points: &[Self],
scalars: &[&[u64; 4]],
window: usize
) -> G2
fn sum_of_products_precomp_256(
points: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self]
) -> G2
[src]
points: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self]
) -> G2