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]
fn to_montgomery(&self) -> MontgomeryPoint
[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.
fn compress(&self) -> CompressedEdwardsY
[src]
Compress this point to CompressedEdwardsY
format.
impl EdwardsPoint
[src]
fn mult_by_cofactor(&self) -> EdwardsPoint
[src]
Multiply by the cofactor: return \([8]P\).
fn is_small_order(&self) -> bool
[src]
Determine if this point is of small order.
Return
true
ifself
is in the torsion subgroup \( \mathcal E[8] \);false
ifself
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);
fn is_torsion_free(&self) -> bool
[src]
Determine if this point is “torsion-free”, i.e., is contained in the prime-order subgroup.
Return
true
ifself
has zero torsion component and is in the prime-order subgroup;false
ifself
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]
fn clone(&self) -> EdwardsPoint
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Identity for EdwardsPoint
[src]
fn identity() -> EdwardsPoint
[src]
Returns the identity element of the curve. Can be used as a constructor. Read more
impl ConditionallyAssignable for EdwardsPoint
[src]
fn conditional_assign(&mut self, other: &EdwardsPoint, choice: u8)
[src]
Conditionally assign other
to self
in constant time. Read more
impl Equal for EdwardsPoint
[src]
fn ct_eq(&self, other: &EdwardsPoint) -> u8
[src]
Determine if two items are equal in constant time. Read more
impl PartialEq for EdwardsPoint
[src]
fn eq(&self, other: &EdwardsPoint) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Eq for EdwardsPoint
[src]
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b EdwardsPoint) -> EdwardsPoint
[src]
Performs the +
operation.
impl<'b> Add<&'b EdwardsPoint> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
[src]
Performs the +
operation.
impl<'a> Add<EdwardsPoint> for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
Performs the +
operation.
impl Add<EdwardsPoint> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
Performs the +
operation.
impl<'b> AddAssign<&'b EdwardsPoint> for EdwardsPoint
[src]
fn add_assign(&mut self, _rhs: &'b EdwardsPoint)
[src]
Performs the +=
operation.
impl AddAssign<EdwardsPoint> for EdwardsPoint
[src]
fn add_assign(&mut self, rhs: EdwardsPoint)
[src]
Performs the +=
operation.
impl<'a, 'b> Sub<&'b EdwardsPoint> for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b EdwardsPoint) -> EdwardsPoint
[src]
Performs the -
operation.
impl<'b> Sub<&'b EdwardsPoint> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
[src]
Performs the -
operation.
impl<'a> Sub<EdwardsPoint> for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
Performs the -
operation.
impl Sub<EdwardsPoint> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
Performs the -
operation.
impl<'b> SubAssign<&'b EdwardsPoint> for EdwardsPoint
[src]
fn sub_assign(&mut self, _rhs: &'b EdwardsPoint)
[src]
Performs the -=
operation.
impl SubAssign<EdwardsPoint> for EdwardsPoint
[src]
fn sub_assign(&mut self, rhs: EdwardsPoint)
[src]
Performs the -=
operation.
impl<'a> Neg for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn neg(self) -> EdwardsPoint
[src]
Performs the unary -
operation.
impl Neg for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn neg(self) -> EdwardsPoint
[src]
Performs the unary -
operation.
impl<'b> MulAssign<&'b Scalar> for EdwardsPoint
[src]
fn mul_assign(&mut self, scalar: &'b Scalar)
[src]
Performs the *=
operation.
impl MulAssign<Scalar> for EdwardsPoint
[src]
fn mul_assign(&mut self, rhs: Scalar)
[src]
Performs the *=
operation.
impl<'b> Mul<&'b Scalar> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> EdwardsPoint
[src]
Performs the *
operation.
impl<'a> Mul<Scalar> for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> EdwardsPoint
[src]
Performs the *
operation.
impl Mul<Scalar> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> EdwardsPoint
[src]
Performs the *
operation.
impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, scalar: &'b Scalar) -> EdwardsPoint
[src]
Scalar multiplication: compute scalar * self
.
For scalar multiplication of a basepoint,
EdwardsBasepointTable
is approximately 4x faster.
impl Debug for EdwardsPoint
[src]
impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a EdwardsPoint
[src]
type Output = CompletedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b ProjectiveNielsPoint) -> CompletedPoint
[src]
Performs the +
operation.
impl<'a, 'b> Sub<&'b ProjectiveNielsPoint> for &'a EdwardsPoint
[src]
type Output = CompletedPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b ProjectiveNielsPoint) -> CompletedPoint
[src]
Performs the -
operation.
impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a EdwardsPoint
[src]
type Output = CompletedPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b AffineNielsPoint) -> CompletedPoint
[src]
Performs the +
operation.