Struct curve25519_dalek::edwards::ExtendedPoint
[−]
[src]
pub struct ExtendedPoint { pub X: FieldElement, pub Y: FieldElement, pub Z: FieldElement, pub T: FieldElement, }
An ExtendedPoint
is a point on the curve in 𝗣³(𝔽ₚ).
A point (x,y) in the affine model corresponds to (x:y:1:xy).
Fields
X: FieldElement
Y: FieldElement
Z: FieldElement
T: FieldElement
Methods
impl ExtendedPoint
[src]
fn to_projective_niels(&self) -> ProjectiveNielsPoint
[src]
Convert to a ProjectiveNielsPoint
fn to_affine_niels(&self) -> AffineNielsPoint
[src]
Dehomogenize to a AffineNielsPoint. Mainly for testing.
fn to_montgomery(&self) -> MontgomeryPoint
[src]
Convert this point to its equivalent on the Montgomery form of the curve.
fn compress(&self) -> CompressedEdwardsY
[src]
Compress this point to CompressedEdwardsY
format.
impl ExtendedPoint
[src]
fn double(&self) -> ExtendedPoint
[src]
Add this point to itself.
impl ExtendedPoint
[src]
fn mult_by_cofactor(&self) -> ExtendedPoint
[src]
Multiply by the cofactor: compute 8 * self
.
Convenience wrapper around mult_by_pow_2
.
fn mult_by_pow_2(&self, k: u32) -> ExtendedPoint
[src]
Compute 2^k * self
by successive doublings.
Requires k > 0
.
fn is_small_order(&self) -> bool
[src]
Determine if this point is of small order.
The order of the group of points on the curve Ɛ is |Ɛ| = 8q. Thus, to check if a point P is of small order, we multiply by 8 and then test if the result is equal to the identity.
Return
True if it is of small order; false otherwise.
impl ExtendedPoint
[src]
fn to_uniform_representative(&self) -> Option<[u8; 32]>
[src]
Use Elligator2 to try to convert self
to a uniformly random
string.
Returns Some<[u8;32]>
if self
is in the image of the
Elligator2 map. For a random point on the curve, this happens
with probability 1/2. Otherwise, returns None
.
fn from_uniform_representative(bytes: &[u8; 32]) -> ExtendedPoint
[src]
Use Elligator2 to convert a uniformly random string to a curve point.
Trait Implementations
impl Copy for ExtendedPoint
[src]
impl Clone for ExtendedPoint
[src]
fn clone(&self) -> ExtendedPoint
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Identity for ExtendedPoint
[src]
fn identity() -> ExtendedPoint
[src]
Returns the identity element of the curve. Can be used as a constructor. Read more
impl ValidityCheck for ExtendedPoint
[src]
impl ConditionallyAssignable for ExtendedPoint
[src]
fn conditional_assign(&mut self, other: &ExtendedPoint, choice: u8)
[src]
Conditionally assign other
to self
in constant time. Read more
impl Equal for ExtendedPoint
[src]
fn ct_eq(&self, other: &ExtendedPoint) -> u8
[src]
Determine if two items are equal in constant time. Read more
impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a ExtendedPoint
[src]
type Output = CompletedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b ProjectiveNielsPoint) -> CompletedPoint
[src]
Performs the +
operation.
impl<'a, 'b> Sub<&'b ProjectiveNielsPoint> for &'a ExtendedPoint
[src]
type Output = CompletedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b ProjectiveNielsPoint) -> CompletedPoint
[src]
Performs the -
operation.
impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a ExtendedPoint
[src]
type Output = CompletedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b AffineNielsPoint) -> CompletedPoint
[src]
Performs the +
operation.
impl<'a, 'b> Sub<&'b AffineNielsPoint> for &'a ExtendedPoint
[src]
type Output = CompletedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b AffineNielsPoint) -> CompletedPoint
[src]
Performs the -
operation.
impl<'a, 'b> Add<&'b ExtendedPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b ExtendedPoint) -> ExtendedPoint
[src]
Performs the +
operation.
impl<'b> AddAssign<&'b ExtendedPoint> for ExtendedPoint
[src]
fn add_assign(&mut self, _rhs: &'b ExtendedPoint)
[src]
Performs the +=
operation.
impl<'a, 'b> Sub<&'b ExtendedPoint> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b ExtendedPoint) -> ExtendedPoint
[src]
Performs the -
operation.
impl<'b> SubAssign<&'b ExtendedPoint> for ExtendedPoint
[src]
fn sub_assign(&mut self, _rhs: &'b ExtendedPoint)
[src]
Performs the -=
operation.
impl<'a> Neg for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator.
fn neg(self) -> ExtendedPoint
[src]
Performs the unary -
operation.
impl<'b> MulAssign<&'b Scalar> for ExtendedPoint
[src]
fn mul_assign(&mut self, scalar: &'b Scalar)
[src]
Performs the *=
operation.
impl<'a, 'b> Mul<&'b Scalar> for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the *
operator.
fn mul(self, scalar: &'b Scalar) -> ExtendedPoint
[src]
Scalar multiplication: compute scalar * self
.
Uses a window of size 4. Note: for scalar multiplication of
the basepoint, basepoint_mult
is approximately 4x faster.