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 21 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_tuple(&self) -> (&Self::Base, &Self::Base);
unsafe fn as_tuple_mut(&mut self) -> (&mut Self::Base, &mut Self::Base);
fn sum_of_products(
bases: &[Self],
scalars: &[&[u64; 4]],
) -> Self::Projective;
fn find_pippinger_window(num_components: usize) -> usize;
fn find_pippinger_window_via_estimate(num_components: usize) -> usize;
fn sum_of_products_pippinger(
bases: &[Self],
scalars: &[&[u64; 4]],
window: usize,
) -> Self::Projective;
fn sum_of_products_precomp_256(
bases: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self],
) -> Self::Projective;
fn precomp_3(&self, pre: &mut [Self]);
fn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self],
) -> Self::Projective;
fn precomp_256(&self, pre: &mut [Self]);
fn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self],
) -> Self::Projective;
// 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§
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§
Sourcefn is_zero(&self) -> bool
fn is_zero(&self) -> bool
Determines if this point represents the point at infinity; the additive identity.
Sourcefn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
) -> Self::Projective
fn mul<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, ) -> Self::Projective
Performs scalar multiplication of this element with mixed addition.
Sourcefn pairing_with(&self, other: &Self::Pair) -> Self::PairingResult
fn pairing_with(&self, other: &Self::Pair) -> Self::PairingResult
Perform a pairing
Sourcefn into_projective(&self) -> Self::Projective
fn into_projective(&self) -> Self::Projective
Converts this element into its affine representation.
Sourcefn as_tuple(&self) -> (&Self::Base, &Self::Base)
fn as_tuple(&self) -> (&Self::Base, &Self::Base)
Borrow references to the X and Y coordinates of this point.
Sourceunsafe fn as_tuple_mut(&mut self) -> (&mut Self::Base, &mut Self::Base)
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.
Sourcefn sum_of_products(bases: &[Self], scalars: &[&[u64; 4]]) -> Self::Projective
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
Sourcefn find_pippinger_window(num_components: usize) -> usize
fn find_pippinger_window(num_components: usize) -> usize
Find the optimal window for running Pippinger’s algorithm; preprogrammed values
Sourcefn find_pippinger_window_via_estimate(num_components: usize) -> usize
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
Sourcefn sum_of_products_pippinger(
bases: &[Self],
scalars: &[&[u64; 4]],
window: usize,
) -> Self::Projective
fn sum_of_products_pippinger( 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
Sourcefn sum_of_products_precomp_256(
bases: &[Self],
scalars: &[&[u64; 4]],
pre: &[Self],
) -> Self::Projective
fn sum_of_products_precomp_256( 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
Sourcefn precomp_3(&self, pre: &mut [Self])
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
Sourcefn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self],
) -> Self::Projective
fn mul_precomp_3<S: Into<<Self::Scalar as PrimeField>::Repr>>( &self, other: S, pre: &[Self], ) -> Self::Projective
Performs scalar multiplication of this element, assuming pre = [(2^64)*self, (2^128)*self, (2^192)*self]
Sourcefn precomp_256(&self, pre: &mut [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
Sourcefn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&self,
other: S,
pre: &[Self],
) -> Self::Projective
fn mul_precomp_256<S: Into<<Self::Scalar as PrimeField>::Repr>>( &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§
Sourcefn into_compressed(&self) -> Self::Compressed
fn into_compressed(&self) -> Self::Compressed
Converts this element into its compressed encoding, so long as it’s not the point at infinity.
Sourcefn into_uncompressed(&self) -> Self::Uncompressed
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.