Struct curve25519_dalek::montgomery::MontgomeryPoint [] [src]

pub struct MontgomeryPoint {
    pub U: FieldElement,
    pub W: FieldElement,
}

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

Methods

impl MontgomeryPoint
[src]

[src]

Compress this point to only its u-coordinate (note: affine).

Returns

A CompressedMontgomeryU.

Trait Implementations

impl Copy for MontgomeryPoint
[src]

impl Clone for MontgomeryPoint
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for MontgomeryPoint
[src]

[src]

Formats the value using the given formatter.

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.

[src]

Returns the identity element of the curve. Can be used as a constructor. Read more

impl Equal for MontgomeryPoint
[src]

Determine if two MontgomeryPoints 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.

[src]

Determine if two items are equal in constant time. Read more

impl ValidityCheck for MontgomeryPoint
[src]

Determine if this MontgomeryPoint is valid.

Note

All projective points, except for (X:W) = (0:0), are valid, since the projective model is linear through the origin and is comprised by all X in ℤ/(2²⁵⁵-19), thus (0:0) is the only element in Fₚ² which is not a projective point.

Returns

true if it is valid, and false otherwise.

[src]

Checks whether the point is on the curve. Not CT.

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.

[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.

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'b> MulAssign<&'b Scalar> for MontgomeryPoint
[src]

[src]

Performs the *= operation.