Struct curve25519_dalek::curve::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
Convert to a ProjectiveNielsPoint
fn to_affine_niels(&self) -> AffineNielsPoint
Dehomogenize to a AffineNielsPoint. Mainly for testing.
fn compress_edwards(&self) -> CompressedEdwardsY
Compress this point to CompressedEdwardsY
format.
fn compress_montgomery(&self) -> Option<CompressedMontgomeryU>
Convert this point to a CompressedMontgomeryU
.
Note that this discards the sign.
Return
None
ifself
is the identity point;Some(CompressedMontgomeryU)
otherwise.
impl ExtendedPoint
[src]
fn double(&self) -> ExtendedPoint
Add this point to itself.
impl ExtendedPoint
[src]
fn mult_by_cofactor(&self) -> ExtendedPoint
Multiply by the cofactor: compute 8 * self
.
Convenience wrapper around mult_by_pow_2
.
fn mult_by_pow_2(&self, k: u32) -> ExtendedPoint
Compute 2^k * self
by successive doublings.
Requires k > 0
.
fn is_small_order(&self) -> bool
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]>
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
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
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Identity for ExtendedPoint
[src]
fn identity() -> ExtendedPoint
Returns the identity element of the curve. Can be used as a constructor. Read more
impl ValidityCheck for ExtendedPoint
[src]
impl CTEq for ExtendedPoint
[src]
fn ct_eq(&self, other: &ExtendedPoint) -> u8
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
The method for the +
operator
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
The method for the -
operator
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
The method for the +
operator
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
The method for the -
operator
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
The method for the +
operator
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
The method for the -
operator
impl<'a> Neg for &'a ExtendedPoint
[src]
type Output = ExtendedPoint
The resulting type after applying the -
operator
fn neg(self) -> ExtendedPoint
The method for the unary -
operator
impl ScalarMult<Scalar> for ExtendedPoint
[src]
fn scalar_mult(&self, scalar: &Scalar) -> ExtendedPoint
Scalar multiplication: compute scalar * self
.
Uses a window of size 4. Note: for scalar multiplication of
the basepoint, basepoint_mult
is approximately 4x faster.
impl BasepointMult<Scalar> for ExtendedPoint
[src]
fn basepoint() -> ExtendedPoint
Return the basepoint B
.
fn basepoint_mult(scalar: &Scalar) -> ExtendedPoint
Compute scalar * B
.