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]

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

[src]

Compress this point to CompressedEdwardsY format.

impl EdwardsPoint
[src]

[src]

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

[src]

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);

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Identity for EdwardsPoint
[src]

[src]

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

impl ConditionallyAssignable for EdwardsPoint
[src]

[src]

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

impl ConstantTimeEq for EdwardsPoint
[src]

[src]

Determine if two items are equal. Read more

impl PartialEq for EdwardsPoint
[src]

[src]

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

1.0.0
[src]

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.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Add<EdwardsPoint> for EdwardsPoint
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

[src]

Performs the += operation.

impl AddAssign<EdwardsPoint> for EdwardsPoint
[src]

[src]

Performs the += operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

impl Sub<EdwardsPoint> for EdwardsPoint
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

[src]

Performs the -= operation.

impl SubAssign<EdwardsPoint> for EdwardsPoint
[src]

[src]

Performs the -= operation.

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

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

impl Neg for EdwardsPoint
[src]

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

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

[src]

Performs the *= operation.

impl MulAssign<Scalar> for EdwardsPoint
[src]

[src]

Performs the *= operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Scalar> for EdwardsPoint
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<EdwardsPoint> for Scalar
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

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.

[src]

Scalar multiplication: compute scalar * self.

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

impl Debug for EdwardsPoint
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for EdwardsPoint

impl Sync for EdwardsPoint