Struct curve25519_dalek::curve::ExtendedPoint [] [src]

pub struct ExtendedPoint { /* fields omitted */ }

An ExtendedPoint is a point on the curve in 𝗣³(𝔽ₚ). A point (x,y) in the affine model corresponds to (x:y:1:xy).

Methods

impl ExtendedPoint
[src]

Convert this point to a CompressedPoint

XXX rewrite We only need the x-coordinate of the curve25519 point, which I'll call u. The isomorphism is u=(y+1)/(1-y), since y=Y/Z, this gives u=(Y+Z)/(Z-Y). We know that Z=1, thus u=(Y+1)/(1-Y).

impl ExtendedPoint
[src]

Scalar multiplication: compute a * self.

Uses a window of size 4. Note: for scalar multiplication of the basepoint, basepoint_mult is approximately 4x faster.

Construct an ExtendedPoint from a Scalar, a, by computing the multiple aB of the basepoint B.

Precondition: the scalar must be reduced.

The computation proceeds as follows, as described on page 13 of the Ed25519 paper. Write the scalar a in radix 16 with coefficients in [-8,8), i.e.,

a = a_0 + a_1*161 + ... + a_63*1663,

with -8 ≤ a_i < 8. Then

a*B = a_0*B + a_1*161*B + ... + a_63*1663*B.

Grouping even and odd coefficients gives

a*B = a_0*160*B + a_2*162*B + ... + a_62*1662*B + a_1*161*B + a_3*163*B + ... + a_63*1663*B = (a_0*160*B + a_2*162*B + ... + a_62*1662*B) + 16*(a_1*160*B + a_3*162*B + ... + a_63*1662*B).

We then use the select_precomputed_point function, which takes -8 ≤ x < 8 and [16^2i * B, ..., 8 * 16^2i * B], and returns x * 16^2i * B in constant time.

Compute 2^k * self by successive doublings. Requires k > 0.

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

Use Elligator2 to convert a uniformly random string to a curve point.

Trait Implementations

impl Copy for ExtendedPoint
[src]

impl Clone for ExtendedPoint
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Identity for ExtendedPoint
[src]

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

impl<'a, 'b> Add<&'b CachedPoint> for &'a ExtendedPoint
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b> Sub<&'b CachedPoint> for &'a ExtendedPoint
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, 'b> Add<&'b PreComputedPoint> for &'a ExtendedPoint
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b> Sub<&'b PreComputedPoint> for &'a ExtendedPoint
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, 'b> Add<&'b ExtendedPoint> for &'a ExtendedPoint
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b> Sub<&'b ExtendedPoint> for &'a ExtendedPoint
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a> Neg for &'a ExtendedPoint
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl Debug for ExtendedPoint
[src]

Formats the value using the given formatter.