Struct curve25519_dalek::edwards::EdwardsPoint[][src]

pub struct EdwardsPoint { /* fields omitted */ }

An EdwardsPoint represents a point on the Edwards form of Curve25519.

Methods

impl EdwardsPoint
[src]

Convert this EdwardsPoint on the Edwards model to the corresponding MontgomeryPoint on the Montgomery model.

Note that this is a one-way conversion, since the Montgomery model does not retain sign information.

Compress this point to CompressedEdwardsY format.

impl EdwardsPoint
[src]

Compute \(aA + bB\) in variable time, where \(B\) is the Ed25519 basepoint.

impl EdwardsPoint
[src]

Multiply by the cofactor: return \([8]P\).

Determine if this point is of small order.

Return

  • true if self is in the torsion subgroup \( \mathcal E[8] \);
  • false if self is not in the torsion subgroup \( \mathcal E[8] \).

Example

use curve25519_dalek::constants;

// Generator of the prime-order subgroup
let P = constants::ED25519_BASEPOINT_POINT;
// Generator of the torsion subgroup
let Q = constants::EIGHT_TORSION[1];

// P has large order
assert_eq!(P.is_small_order(), false);

// Q has small order
assert_eq!(Q.is_small_order(), true);

Determine if this point is “torsion-free”, i.e., is contained in the prime-order subgroup.

Return

  • true if self has zero torsion component and is in the prime-order subgroup;
  • false if self has a nonzero torsion component and is not in the prime-order subgroup.

Example

use curve25519_dalek::constants;

// Generator of the prime-order subgroup
let P = constants::ED25519_BASEPOINT_POINT;
// Generator of the torsion subgroup
let Q = constants::EIGHT_TORSION[1];

// P is torsion-free
assert_eq!(P.is_torsion_free(), true);

// P + Q is not torsion-free
assert_eq!((P+Q).is_torsion_free(), false);

Trait Implementations

impl Copy for EdwardsPoint
[src]

impl Clone for EdwardsPoint
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Identity for EdwardsPoint
[src]

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

impl Default for EdwardsPoint
[src]

Returns the "default value" for a type. Read more

impl ConditionallyAssignable for EdwardsPoint
[src]

Conditionally assign other to self, according to choice. Read more

impl ConstantTimeEq for EdwardsPoint
[src]

Determine if two items are equal. Read more

impl PartialEq for EdwardsPoint
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for EdwardsPoint
[src]

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

The resulting type after applying the + operator.

Performs the + operation.

impl<'b> Add<&'b EdwardsPoint> for EdwardsPoint
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'a> Add<EdwardsPoint> for &'a EdwardsPoint
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl Add<EdwardsPoint> for EdwardsPoint
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'b> AddAssign<&'b EdwardsPoint> for EdwardsPoint
[src]

Performs the += operation.

impl AddAssign<EdwardsPoint> for EdwardsPoint
[src]

Performs the += operation.

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

The resulting type after applying the - operator.

Performs the - operation.

impl<'b> Sub<&'b EdwardsPoint> for EdwardsPoint
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<'a> Sub<EdwardsPoint> for &'a EdwardsPoint
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl Sub<EdwardsPoint> for EdwardsPoint
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<'b> SubAssign<&'b EdwardsPoint> for EdwardsPoint
[src]

Performs the -= operation.

impl SubAssign<EdwardsPoint> for EdwardsPoint
[src]

Performs the -= operation.

impl<T> Sum<T> for EdwardsPoint where
    T: Borrow<EdwardsPoint>, 
[src]

Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more

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

The resulting type after applying the - operator.

Performs the unary - operation.

impl Neg for EdwardsPoint
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

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

Performs the *= operation.

impl MulAssign<Scalar> for EdwardsPoint
[src]

Performs the *= operation.

impl<'b> Mul<&'b Scalar> for EdwardsPoint
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<Scalar> for &'a EdwardsPoint
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Scalar> for EdwardsPoint
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'b> Mul<&'b EdwardsPoint> for Scalar
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a> Mul<EdwardsPoint> for &'a Scalar
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<EdwardsPoint> for Scalar
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint
[src]

The resulting type after applying the * operator.

Scalar multiplication: compute scalar * self.

For scalar multiplication of a basepoint, EdwardsBasepointTable is approximately 4x faster.

impl<'a, 'b> Mul<&'b EdwardsPoint> for &'a Scalar
[src]

The resulting type after applying the * operator.

Scalar multiplication: compute scalar * self.

For scalar multiplication of a basepoint, EdwardsBasepointTable is approximately 4x faster.

impl MultiscalarMul for EdwardsPoint
[src]

The type of point being multiplied, e.g., RistrettoPoint.

Given an iterator of (possibly secret) scalars and an iterator of public points, compute $$ Q = c_1 P_1 + \cdots + c_n P_n. $$ Read more

impl VartimeMultiscalarMul for EdwardsPoint
[src]

The type of point being multiplied, e.g., RistrettoPoint.

Given an iterator of public scalars and an iterator of Options of points, compute either Some(Q), where $$ Q = c_1 P_1 + \cdots + c_n P_n, $$ if all points were Some(P_i), or else return None. Read more

Given an iterator of public scalars and an iterator of public points, compute $$ Q = c_1 P_1 + \cdots + c_n P_n, $$ using variable-time operations. Read more

impl Debug for EdwardsPoint
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations