Struct dalek_ff_group::EdwardsPoint
source · pub struct EdwardsPoint(pub EdwardsPoint);
Expand description
Wrapper around the dalek Point type. For Ed25519, this is restricted to the prime subgroup.
Tuple Fields§
§0: EdwardsPoint
Implementations§
source§impl EdwardsPoint
impl EdwardsPoint
pub fn mul_by_cofactor(&self) -> EdwardsPoint
Methods from Deref<Target = DEdwardsPoint>§
sourcepub fn to_montgomery(&self) -> MontgomeryPoint
pub fn to_montgomery(&self) -> MontgomeryPoint
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.
sourcepub fn compress(&self) -> CompressedEdwardsY
pub fn compress(&self) -> CompressedEdwardsY
Compress this point to CompressedEdwardsY
format.
sourcepub fn mul_by_cofactor(&self) -> EdwardsPoint
pub fn mul_by_cofactor(&self) -> EdwardsPoint
Multiply by the cofactor: return \([8]P\).
sourcepub fn is_small_order(&self) -> bool
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);
sourcepub fn is_torsion_free(&self) -> bool
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§
source§impl<'a> Add<&'a EdwardsPoint> for EdwardsPoint
impl<'a> Add<&'a EdwardsPoint> for EdwardsPoint
§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+
operator.source§impl Add for EdwardsPoint
impl Add for EdwardsPoint
§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
+
operator.source§impl<'a> AddAssign<&'a EdwardsPoint> for EdwardsPoint
impl<'a> AddAssign<&'a EdwardsPoint> for EdwardsPoint
source§fn add_assign(&mut self, other: &'a EdwardsPoint)
fn add_assign(&mut self, other: &'a EdwardsPoint)
Performs the
+=
operation. Read moresource§impl AddAssign for EdwardsPoint
impl AddAssign for EdwardsPoint
source§fn add_assign(&mut self, other: EdwardsPoint)
fn add_assign(&mut self, other: EdwardsPoint)
Performs the
+=
operation. Read moresource§impl Borrow<EdwardsPoint> for &EdwardsPoint
impl Borrow<EdwardsPoint> for &EdwardsPoint
source§fn borrow(&self) -> &DEdwardsPoint
fn borrow(&self) -> &DEdwardsPoint
Immutably borrows from an owned value. Read more
source§impl Borrow<EdwardsPoint> for EdwardsPoint
impl Borrow<EdwardsPoint> for EdwardsPoint
source§fn borrow(&self) -> &DEdwardsPoint
fn borrow(&self) -> &DEdwardsPoint
Immutably borrows from an owned value. Read more
source§impl Clone for EdwardsPoint
impl Clone for EdwardsPoint
source§fn clone(&self) -> EdwardsPoint
fn clone(&self) -> EdwardsPoint
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ConditionallySelectable for EdwardsPoint
impl ConditionallySelectable for EdwardsPoint
source§impl ConstantTimeEq for EdwardsPoint
impl ConstantTimeEq for EdwardsPoint
source§impl Debug for EdwardsPoint
impl Debug for EdwardsPoint
source§impl Deref for EdwardsPoint
impl Deref for EdwardsPoint
source§impl Group for EdwardsPoint
impl Group for EdwardsPoint
source§impl GroupEncoding for EdwardsPoint
impl GroupEncoding for EdwardsPoint
source§impl Hash for EdwardsPoint
impl Hash for EdwardsPoint
source§impl<'a> Mul<&'a Scalar> for EdwardsPoint
impl<'a> Mul<&'a Scalar> for EdwardsPoint
source§impl Mul<Scalar> for EdwardsPoint
impl Mul<Scalar> for EdwardsPoint
source§impl<'a> MulAssign<&'a Scalar> for EdwardsPoint
impl<'a> MulAssign<&'a Scalar> for EdwardsPoint
source§fn mul_assign(&mut self, other: &'a Scalar)
fn mul_assign(&mut self, other: &'a Scalar)
Performs the
*=
operation. Read moresource§impl MulAssign<Scalar> for EdwardsPoint
impl MulAssign<Scalar> for EdwardsPoint
source§fn mul_assign(&mut self, other: Scalar)
fn mul_assign(&mut self, other: Scalar)
Performs the
*=
operation. Read moresource§impl Neg for EdwardsPoint
impl Neg for EdwardsPoint
source§impl PartialEq for EdwardsPoint
impl PartialEq for EdwardsPoint
source§fn eq(&self, other: &EdwardsPoint) -> bool
fn eq(&self, other: &EdwardsPoint) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> Sub<&'a EdwardsPoint> for EdwardsPoint
impl<'a> Sub<&'a EdwardsPoint> for EdwardsPoint
§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
-
operator.source§impl Sub for EdwardsPoint
impl Sub for EdwardsPoint
§type Output = EdwardsPoint
type Output = EdwardsPoint
The resulting type after applying the
-
operator.source§impl<'a> SubAssign<&'a EdwardsPoint> for EdwardsPoint
impl<'a> SubAssign<&'a EdwardsPoint> for EdwardsPoint
source§fn sub_assign(&mut self, other: &'a EdwardsPoint)
fn sub_assign(&mut self, other: &'a EdwardsPoint)
Performs the
-=
operation. Read moresource§impl SubAssign for EdwardsPoint
impl SubAssign for EdwardsPoint
source§fn sub_assign(&mut self, other: EdwardsPoint)
fn sub_assign(&mut self, other: EdwardsPoint)
Performs the
-=
operation. Read moresource§impl<'a> Sum<&'a EdwardsPoint> for EdwardsPoint
impl<'a> Sum<&'a EdwardsPoint> for EdwardsPoint
source§fn sum<I: Iterator<Item = &'a EdwardsPoint>>(iter: I) -> EdwardsPoint
fn sum<I: Iterator<Item = &'a EdwardsPoint>>(iter: I) -> EdwardsPoint
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items.source§impl Sum for EdwardsPoint
impl Sum for EdwardsPoint
source§fn sum<I: Iterator<Item = EdwardsPoint>>(iter: I) -> EdwardsPoint
fn sum<I: Iterator<Item = EdwardsPoint>>(iter: I) -> EdwardsPoint
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items.source§impl Zeroize for EdwardsPoint
impl Zeroize for EdwardsPoint
impl Copy for EdwardsPoint
impl Eq for EdwardsPoint
impl PrimeGroup for EdwardsPoint
impl StructuralPartialEq for EdwardsPoint
Auto Trait Implementations§
impl Freeze for EdwardsPoint
impl RefUnwindSafe for EdwardsPoint
impl Send for EdwardsPoint
impl Sync for EdwardsPoint
impl Unpin for EdwardsPoint
impl UnwindSafe for EdwardsPoint
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.