[−][src]Struct curve25519_dalek::edwards::EdwardsPoint
An EdwardsPoint
represents a point on the Edwards form of Curve25519.
Methods
impl EdwardsPoint
[src]
pub fn to_montgomery(&self) -> MontgomeryPoint
[src]
Convert this EdwardsPoint
on the Edwards model to the
corresponding MontgomeryPoint
on the Montgomery model.
This function has one exceptional case; the identity point of the Edwards curve is sent to the 2-torsion point \((0,0)\) on the Montgomery curve.
Note that this is a one-way conversion, since the Montgomery model does not retain sign information.
pub fn compress(&self) -> CompressedEdwardsY
[src]
Compress this point to CompressedEdwardsY
format.
impl EdwardsPoint
[src]
pub fn vartime_double_scalar_mul_basepoint(
a: &Scalar,
A: &EdwardsPoint,
b: &Scalar
) -> EdwardsPoint
[src]
a: &Scalar,
A: &EdwardsPoint,
b: &Scalar
) -> EdwardsPoint
Compute \(aA + bB\) in variable time, where \(B\) is the Ed25519 basepoint.
impl EdwardsPoint
[src]
pub fn mul_by_cofactor(&self) -> EdwardsPoint
[src]
Multiply by the cofactor: return \([8]P\).
pub 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);
pub 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 Identity for EdwardsPoint
[src]
fn identity() -> EdwardsPoint
[src]
impl MultiscalarMul for EdwardsPoint
[src]
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]
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<EdwardsPoint>,
impl VartimeMultiscalarMul for EdwardsPoint
[src]
type Point = EdwardsPoint
The type of point being multiplied, e.g., RistrettoPoint
.
fn optional_multiscalar_mul<I, J>(scalars: I, points: J) -> Option<EdwardsPoint> where
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator<Item = Option<EdwardsPoint>>,
[src]
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator<Item = Option<EdwardsPoint>>,
fn vartime_multiscalar_mul<I, J>(scalars: I, points: J) -> Self::Point where
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<Self::Point>,
Self::Point: Clone,
[src]
I: IntoIterator,
I::Item: Borrow<Scalar>,
J: IntoIterator,
J::Item: Borrow<Self::Point>,
Self::Point: Clone,
impl Debug for EdwardsPoint
[src]
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]
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]
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]
impl Sub<EdwardsPoint> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn sub(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
impl PartialEq<EdwardsPoint> for EdwardsPoint
[src]
fn eq(&self, other: &EdwardsPoint) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
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]
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]
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]
impl Add<EdwardsPoint> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the +
operator.
fn add(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
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]
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]
impl Mul<Scalar> for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> EdwardsPoint
[src]
impl<'b> Mul<&'b EdwardsPoint> for Scalar
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b EdwardsPoint) -> EdwardsPoint
[src]
impl<'a> Mul<EdwardsPoint> for &'a Scalar
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
impl Mul<EdwardsPoint> for Scalar
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, rhs: EdwardsPoint) -> EdwardsPoint
[src]
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<'a, 'b> Mul<&'b EdwardsPoint> for &'a Scalar
[src]
type Output = EdwardsPoint
The resulting type after applying the *
operator.
fn mul(self, point: &'b EdwardsPoint) -> EdwardsPoint
[src]
Scalar multiplication: compute scalar * self
.
For scalar multiplication of a basepoint,
EdwardsBasepointTable
is approximately 4x faster.
impl<'a> Neg for &'a EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn neg(self) -> EdwardsPoint
[src]
impl Neg for EdwardsPoint
[src]
type Output = EdwardsPoint
The resulting type after applying the -
operator.
fn neg(self) -> EdwardsPoint
[src]
impl<'b> AddAssign<&'b EdwardsPoint> for EdwardsPoint
[src]
fn add_assign(&mut self, _rhs: &'b EdwardsPoint)
[src]
impl AddAssign<EdwardsPoint> for EdwardsPoint
[src]
fn add_assign(&mut self, rhs: EdwardsPoint)
[src]
impl<'b> SubAssign<&'b EdwardsPoint> for EdwardsPoint
[src]
fn sub_assign(&mut self, _rhs: &'b EdwardsPoint)
[src]
impl SubAssign<EdwardsPoint> for EdwardsPoint
[src]
fn sub_assign(&mut self, rhs: EdwardsPoint)
[src]
impl<'b> MulAssign<&'b Scalar> for EdwardsPoint
[src]
fn mul_assign(&mut self, scalar: &'b Scalar)
[src]
impl MulAssign<Scalar> for EdwardsPoint
[src]
fn mul_assign(&mut self, rhs: Scalar)
[src]
impl Copy for EdwardsPoint
[src]
impl<T> Sum<T> for EdwardsPoint where
T: Borrow<EdwardsPoint>,
[src]
T: Borrow<EdwardsPoint>,
impl Clone for EdwardsPoint
[src]
fn clone(&self) -> EdwardsPoint
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for EdwardsPoint
[src]
fn default() -> EdwardsPoint
[src]
impl ConstantTimeEq for EdwardsPoint
[src]
fn ct_eq(&self, other: &EdwardsPoint) -> Choice
[src]
impl ConditionallySelectable for EdwardsPoint
[src]
fn conditional_select(
a: &EdwardsPoint,
b: &EdwardsPoint,
choice: Choice
) -> EdwardsPoint
[src]
a: &EdwardsPoint,
b: &EdwardsPoint,
choice: Choice
) -> EdwardsPoint
fn conditional_assign(&mut self, other: &Self, choice: Choice)
[src]
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
[src]
impl Serialize for EdwardsPoint
[src]
impl<'de> Deserialize<'de> for EdwardsPoint
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for EdwardsPoint
impl Send for EdwardsPoint
impl Sync for EdwardsPoint
impl UnwindSafe for EdwardsPoint
impl RefUnwindSafe for EdwardsPoint
Blanket Implementations
impl<T> IsIdentity for T where
T: ConstantTimeEq + Identity,
[src]
T: ConstantTimeEq + Identity,
fn is_identity(&Self) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
[src]
T: InitializableFromZeroed + ?Sized,
impl<T> InitializableFromZeroed for T where
T: Default,
[src]
T: Default,
unsafe fn initialize(place: *mut T)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: Neg,
<&'a T as Neg>::Output == T,
[src]
T: ConditionallySelectable,
&'a T: Neg,
<&'a T as Neg>::Output == T,
fn conditional_negate(&mut self, choice: Choice)
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,