Struct curve25519_dalek::montgomery::MontgomeryPoint
[−]
[src]
pub struct MontgomeryPoint { pub U: FieldElement32, pub W: FieldElement32, }
A point on the Montgomery form of the curve, in projective 𝗣2 coordinates.
The transition between affine and projective is given by
u → U/W v → V/W
thus the Montgomery curve equation
E_(A,B) : Bv² = u(u² + Au + 1)
becomes
E_(A,B) : BV²W = U(U² + AUW + W²) ⊆ 𝗣2
Here, again, to differentiate from points in the twisted Edwards model, we
call the point (x,y)
in affine coordinates (u,v)
and similarly in projective
space we use (U:V:W)
. However, since (as per Montgomery's original work) the
v-coordinate is superfluous for the purposes of scalar multiplication, we merely
use (U:W)
.
Fields
U: FieldElement32
W: FieldElement32
Methods
impl MontgomeryPoint
[src]
fn compress(&self) -> CompressedMontgomeryU
[src]
Trait Implementations
impl Copy for MontgomeryPoint
[src]
impl Clone for MontgomeryPoint
[src]
fn clone(&self) -> MontgomeryPoint
[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 Debug for MontgomeryPoint
[src]
impl Identity for MontgomeryPoint
[src]
The identity point is a unique point (the only where W = 0
) on the curve.
In projective coordinates, the quotient map x : E (A,B) → E/<⦵> = 𝗣¹
is
⎧ (x_P:1) if P = (x_P:y_P:1) , x : P ↦ ⎨ ⎩ (1:0) if P = O = (0:1:0) .
We emphasize that the formula x((U: V : W)) = (U : W)
only holds on the
open subset of E_(A,B)
where W ≠ 0
; it does not extend to the point
O = (0:1:0)
at infinity, because (0:0)
is not a projective point.
Returns
The (exceptional) point at infinity in the Montgomery model.
fn identity() -> MontgomeryPoint
[src]
Returns the identity element of the curve. Can be used as a constructor. Read more
impl Equal for MontgomeryPoint
[src]
Determine if two MontgomeryPoint
s are equal, in constant time.
Note
Because a compressed point on the Montgomery form of the curve doesn't include the sign bit, there's two points here (if translated from the Edwards form) which will equate.
Returns
1
if the points are equal, and 0
otherwise.
fn ct_eq(&self, that: &MontgomeryPoint) -> u8
[src]
Determine if two items are equal in constant time. Read more
impl ConditionallyAssignable for MontgomeryPoint
[src]
Conditionally assign another MontgomeryPoint
to this point, in constant time.
If choice == 1
, assign that
to self
. Otherwise, leave self
unchanged.
fn conditional_assign(&mut self, that: &MontgomeryPoint, choice: Mask)
[src]
Conditionally assign other
to self
in constant time. Read more
impl<'a, 'b> Mul<&'b Scalar> for &'a MontgomeryPoint
[src]
Multiply this MontgomeryPoint
by a Scalar
.
The reader is refered to §5.3 of "Montgomery Curves and Their Arithmetic" by Craig Costello and Benjamin Smith for an overview of side-channel-free Montgomery laddering algorithms.
type Output = MontgomeryPoint
The resulting type after applying the *
operator.
fn mul(self, scalar: &'b Scalar) -> MontgomeryPoint
[src]
Performs the *
operation.
impl<'b> MulAssign<&'b Scalar> for MontgomeryPoint
[src]
fn mul_assign(&mut self, scalar: &'b Scalar)
[src]
Performs the *=
operation.