logo
pub struct MontgomeryPoint(pub [u8; 32]);
Expand description

Holds the \(u\)-coordinate of a point on the Montgomery form of Curve25519 or its twist.

Tuple Fields

0: [u8; 32]

Implementations

View this MontgomeryPoint as an array of bytes.

Convert this MontgomeryPoint to an array of bytes.

Attempt to convert to an EdwardsPoint, using the supplied choice of sign for the EdwardsPoint.

Inputs
  • sign: a u8 donating the desired sign of the resulting EdwardsPoint. 0 denotes positive and 1 negative.
Return
  • Some(EdwardsPoint) if self is the \(u\)-coordinate of a point on (the Montgomery form of) Curve25519;

  • None if self is the \(u\)-coordinate of a point on the twist of (the Montgomery form of) Curve25519;

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Equality of MontgomeryPoints is defined mod p.

Determine if two items are equal. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Return the group identity element, which has order 4.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Multiply this MontgomeryPoint by a Scalar.

Given self \( = u_0(P) \), and a Scalar \(n\), return \( u_0([n]P) \).

The resulting type after applying the * operator.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

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

This method tests for !=.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Return true if this element is the identity element of the curve.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.