pub trait CurveProjective:
PartialEq
+ Eq
+ Sized
+ Copy
+ Clone
+ Send
+ Sync
+ Debug
+ Display
+ 'static
+ Serialize
+ Deserialize<'static> {
type Engine: ScalarEngine<Fr = Self::Scalar>;
type Scalar: PrimeField + SqrtField;
type Base: SqrtField;
type Affine: CurveAffine<Projective = Self, Scalar = Self::Scalar>;
Show 16 methods
// Required methods
fn random<R: RngCore>(rng: &mut R) -> Self;
fn zero() -> Self;
fn one() -> Self;
fn is_zero(&self) -> bool;
fn batch_normalization<S: BorrowMut<Self>>(v: &mut [S]);
fn is_normalized(&self) -> bool;
fn double(&mut self);
fn add_assign(&mut self, other: &Self);
fn add_assign_mixed(&mut self, other: &Self::Affine);
fn negate(&mut self);
fn mul_assign<S: Into<<Self::Scalar as PrimeField>::Repr>>(
&mut self,
other: S,
);
fn into_affine(&self) -> Self::Affine;
fn recommended_wnaf_for_scalar(
scalar: <Self::Scalar as PrimeField>::Repr,
) -> usize;
fn recommended_wnaf_for_num_scalars(num_scalars: usize) -> usize;
fn hash(msg: &[u8]) -> Self;
// Provided method
fn sub_assign(&mut self, other: &Self) { ... }
}
Expand description
Projective representation of an elliptic curve point guaranteed to be in the correct prime order subgroup.
Required Associated Types§
type Engine: ScalarEngine<Fr = Self::Scalar>
type Scalar: PrimeField + SqrtField
type Base: SqrtField
type Affine: CurveAffine<Projective = Self, Scalar = Self::Scalar>
Required Methods§
Sourcefn random<R: RngCore>(rng: &mut R) -> Self
fn random<R: RngCore>(rng: &mut R) -> Self
Returns an element chosen uniformly at random using a user-provided RNG.
Sourcefn batch_normalization<S: BorrowMut<Self>>(v: &mut [S])
fn batch_normalization<S: BorrowMut<Self>>(v: &mut [S])
Normalizes a slice of projective elements so that conversion to affine is cheap.
Sourcefn is_normalized(&self) -> bool
fn is_normalized(&self) -> bool
Checks if the point is already “normalized” so that cheap affine conversion is possible.
Sourcefn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Adds another element to this element.
Sourcefn add_assign_mixed(&mut self, other: &Self::Affine)
fn add_assign_mixed(&mut self, other: &Self::Affine)
Adds an affine element to this element.
Sourcefn mul_assign<S: Into<<Self::Scalar as PrimeField>::Repr>>(&mut self, other: S)
fn mul_assign<S: Into<<Self::Scalar as PrimeField>::Repr>>(&mut self, other: S)
Performs scalar multiplication of this element.
Sourcefn into_affine(&self) -> Self::Affine
fn into_affine(&self) -> Self::Affine
Converts this element into its affine representation.
Sourcefn recommended_wnaf_for_scalar(
scalar: <Self::Scalar as PrimeField>::Repr,
) -> usize
fn recommended_wnaf_for_scalar( scalar: <Self::Scalar as PrimeField>::Repr, ) -> usize
Recommends a wNAF window table size given a scalar. Always returns a number between 2 and 22, inclusive.
Sourcefn recommended_wnaf_for_num_scalars(num_scalars: usize) -> usize
fn recommended_wnaf_for_num_scalars(num_scalars: usize) -> usize
Recommends a wNAF window size given the number of scalars you intend to multiply a base by. Always returns a number between 2 and 22, inclusive.
fn hash(msg: &[u8]) -> Self
Provided Methods§
Sourcefn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Subtracts another element from this element.
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.