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]
impl EdwardsPoint
pub fn to_montgomery(&self) -> MontgomeryPoint
[src]
pub fn to_montgomery(&self) -> MontgomeryPoint
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.
pub fn compress(&self) -> CompressedEdwardsY
[src]
pub fn compress(&self) -> CompressedEdwardsY
Compress this point to CompressedEdwardsY
format.
impl EdwardsPoint
[src]
impl EdwardsPoint
pub fn vartime_double_scalar_mul_basepoint(
a: &Scalar,
A: &EdwardsPoint,
b: &Scalar
) -> EdwardsPoint
[src]
pub fn vartime_double_scalar_mul_basepoint(
a: &Scalar,
A: &EdwardsPoint,
b: &Scalar
) -> EdwardsPoint
Compute \(aA + bB\) in variable time, where \(B\) is the Ed25519 basepoint.
XXX eliminate this function when we have the precomputation API
impl EdwardsPoint
[src]
impl EdwardsPoint
pub fn mul_by_cofactor(&self) -> EdwardsPoint
[src]
pub fn mul_by_cofactor(&self) -> EdwardsPoint
Multiply by the cofactor: return \([8]P\).
pub fn is_small_order(&self) -> bool
[src]
pub fn is_small_order(&self) -> bool
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);
pub fn is_torsion_free(&self) -> bool
[src]
pub fn is_torsion_free(&self) -> bool
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 Copy for EdwardsPoint
impl Clone for EdwardsPoint
[src]
impl Clone for EdwardsPoint
fn clone(&self) -> EdwardsPoint
[src]
fn clone(&self) -> EdwardsPoint
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Identity for EdwardsPoint
[src]
impl Identity for EdwardsPoint
fn identity() -> EdwardsPoint
[src]
fn identity() -> EdwardsPoint
Returns the identity element of the curve. Can be used as a constructor. Read more
impl ConditionallyAssignable for EdwardsPoint
[src]
impl ConditionallyAssignable for EdwardsPoint
fn conditional_assign(&mut self, other: &EdwardsPoint, choice: Choice)
[src]
fn conditional_assign(&mut self, other: &EdwardsPoint, choice: Choice)
Conditionally assign other
to self
, according to choice
. Read more
impl ConstantTimeEq for EdwardsPoint
[src]
impl ConstantTimeEq for EdwardsPoint
fn ct_eq(&self, other: &EdwardsPoint) -> Choice
[src]
fn ct_eq(&self, other: &EdwardsPoint) -> Choice
Determine if two items are equal. Read more
impl PartialEq for EdwardsPoint
[src]
impl PartialEq for EdwardsPoint
fn eq(&self, other: &EdwardsPoint) -> bool
[src]
fn eq(&self, other: &EdwardsPoint) -> bool
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]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Eq for EdwardsPoint
[src]
impl Eq for EdwardsPoint
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a EdwardsPoint
[src]
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, other: &'b EdwardsPoint) -> EdwardsPoint
[src]
fn add(self, other: &'b EdwardsPoint) -> EdwardsPoint
Performs the +
operation.
impl<'b> Add<&'b EdwardsPoint> for EdwardsPoint
[src]
impl<'b> Add<&'b EdwardsPoint> for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
[src]
fn add(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
Performs the +
operation.
impl<'a> Add<EdwardsPoint> for &'a EdwardsPoint
[src]
impl<'a> Add<EdwardsPoint> for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the +
operation.
impl Add<EdwardsPoint> for EdwardsPoint
[src]
impl Add<EdwardsPoint> for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the +
operation.
impl<'b> AddAssign<&'b EdwardsPoint> for EdwardsPoint
[src]
impl<'b> AddAssign<&'b EdwardsPoint> for EdwardsPoint
fn add_assign(&mut self, _rhs: &'b EdwardsPoint)
[src]
fn add_assign(&mut self, _rhs: &'b EdwardsPoint)
Performs the +=
operation.
impl AddAssign<EdwardsPoint> for EdwardsPoint
[src]
impl AddAssign<EdwardsPoint> for EdwardsPoint
fn add_assign(&mut self, rhs: EdwardsPoint)
[src]
fn add_assign(&mut self, rhs: EdwardsPoint)
Performs the +=
operation.
impl<'a, 'b> Sub<&'b EdwardsPoint> for &'a EdwardsPoint
[src]
impl<'a, 'b> Sub<&'b EdwardsPoint> for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, other: &'b EdwardsPoint) -> EdwardsPoint
[src]
fn sub(self, other: &'b EdwardsPoint) -> EdwardsPoint
Performs the -
operation.
impl<'b> Sub<&'b EdwardsPoint> for EdwardsPoint
[src]
impl<'b> Sub<&'b EdwardsPoint> for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
[src]
fn sub(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
Performs the -
operation.
impl<'a> Sub<EdwardsPoint> for &'a EdwardsPoint
[src]
impl<'a> Sub<EdwardsPoint> for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the -
operation.
impl Sub<EdwardsPoint> for EdwardsPoint
[src]
impl Sub<EdwardsPoint> for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the -
operation.
impl<'b> SubAssign<&'b EdwardsPoint> for EdwardsPoint
[src]
impl<'b> SubAssign<&'b EdwardsPoint> for EdwardsPoint
fn sub_assign(&mut self, _rhs: &'b EdwardsPoint)
[src]
fn sub_assign(&mut self, _rhs: &'b EdwardsPoint)
Performs the -=
operation.
impl SubAssign<EdwardsPoint> for EdwardsPoint
[src]
impl SubAssign<EdwardsPoint> for EdwardsPoint
fn sub_assign(&mut self, rhs: EdwardsPoint)
[src]
fn sub_assign(&mut self, rhs: EdwardsPoint)
Performs the -=
operation.
impl<T> Sum<T> for EdwardsPoint where
T: Borrow<EdwardsPoint>,
[src]
impl<T> Sum<T> for EdwardsPoint where
T: Borrow<EdwardsPoint>,
fn sum<I>(iter: I) -> Self where
I: Iterator<Item = T>,
[src]
fn sum<I>(iter: I) -> Self where
I: Iterator<Item = T>,
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]
impl<'a> Neg for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn neg(self) -> EdwardsPoint
[src]
fn neg(self) -> EdwardsPoint
Performs the unary -
operation.
impl Neg for EdwardsPoint
[src]
impl Neg for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn neg(self) -> EdwardsPoint
[src]
fn neg(self) -> EdwardsPoint
Performs the unary -
operation.
impl<'b> MulAssign<&'b Scalar> for EdwardsPoint
[src]
impl<'b> MulAssign<&'b Scalar> for EdwardsPoint
fn mul_assign(&mut self, scalar: &'b Scalar)
[src]
fn mul_assign(&mut self, scalar: &'b Scalar)
Performs the *=
operation.
impl MulAssign<Scalar> for EdwardsPoint
[src]
impl MulAssign<Scalar> for EdwardsPoint
fn mul_assign(&mut self, rhs: Scalar)
[src]
fn mul_assign(&mut self, rhs: Scalar)
Performs the *=
operation.
impl<'b> Mul<&'b Scalar> for EdwardsPoint
[src]
impl<'b> Mul<&'b Scalar> for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> EdwardsPoint
[src]
fn mul(self, rhs: &'b Scalar) -> EdwardsPoint
Performs the *
operation.
impl<'a> Mul<Scalar> for &'a EdwardsPoint
[src]
impl<'a> Mul<Scalar> for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> EdwardsPoint
[src]
fn mul(self, rhs: Scalar) -> EdwardsPoint
Performs the *
operation.
impl Mul<Scalar> for EdwardsPoint
[src]
impl Mul<Scalar> for EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> EdwardsPoint
[src]
fn mul(self, rhs: Scalar) -> EdwardsPoint
Performs the *
operation.
impl<'b> Mul<&'b EdwardsPoint> for Scalar
[src]
impl<'b> Mul<&'b EdwardsPoint> for Scalar
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
[src]
fn mul(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
Performs the *
operation.
impl<'a> Mul<EdwardsPoint> for &'a Scalar
[src]
impl<'a> Mul<EdwardsPoint> for &'a Scalar
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
fn mul(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the *
operation.
impl Mul<EdwardsPoint> for Scalar
[src]
impl Mul<EdwardsPoint> for Scalar
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
fn mul(self, rhs: EdwardsPoint) -> EdwardsPoint
Performs the *
operation.
impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint
[src]
impl<'a, 'b> Mul<&'b Scalar> for &'a EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, scalar: &'b Scalar) -> EdwardsPoint
[src]
fn mul(self, scalar: &'b Scalar) -> EdwardsPoint
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]
impl<'a, 'b> Mul<&'b EdwardsPoint> for &'a Scalar
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, point: &'b EdwardsPoint) -> EdwardsPoint
[src]
fn mul(self, point: &'b EdwardsPoint) -> EdwardsPoint
Scalar multiplication: compute scalar * self
.
For scalar multiplication of a basepoint,
EdwardsBasepointTable
is approximately 4x faster.
impl MultiscalarMul for EdwardsPoint
[src]
impl MultiscalarMul for EdwardsPoint
type Point = EdwardsPoint
The type of point being multiplied, e.g., RistrettoPoint
.
fn multiscalar_mul<I, J>(scalars: I, points: J) -> EdwardsPoint where
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<EdwardsPoint>,
[src]
fn multiscalar_mul<I, J>(scalars: I, points: J) -> EdwardsPoint where
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<EdwardsPoint>,
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]
impl VartimeMultiscalarMul for EdwardsPoint
type Point = EdwardsPoint
The type of point being multiplied, e.g., RistrettoPoint
.
fn vartime_multiscalar_mul<I, J>(scalars: I, points: J) -> EdwardsPoint where
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<EdwardsPoint>,
[src]
fn vartime_multiscalar_mul<I, J>(scalars: I, points: J) -> EdwardsPoint where
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<EdwardsPoint>,
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 Debug for EdwardsPoint
[src]
impl Debug for EdwardsPoint
Auto Trait Implementations
impl Send for EdwardsPoint
impl Send for EdwardsPoint
impl Sync for EdwardsPoint
impl Sync for EdwardsPoint