ExtendedPoint

Struct ExtendedPoint 

Source
pub struct ExtendedPoint(pub(super) FieldElement2625x4);
Expand description

A point on Curve25519, using parallel Edwards formulas for curve operations.

§Invariant

The coefficients of an ExtendedPoint are bounded with \( b < 0.007 \).

Tuple Fields§

§0: FieldElement2625x4

Implementations§

Source§

impl ExtendedPoint

Source

pub fn double(&self) -> ExtendedPoint

Compute the double of this point.

Source

pub fn mul_by_pow_2(&self, k: u32) -> ExtendedPoint

Trait Implementations§

Source§

impl Add<&CachedPoint> for &ExtendedPoint

Source§

fn add(self, other: &CachedPoint) -> ExtendedPoint

Add an ExtendedPoint and a CachedPoint.

Source§

type Output = ExtendedPoint

The resulting type after applying the + operator.
Source§

impl Clone for ExtendedPoint

Source§

fn clone(&self) -> ExtendedPoint

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConditionallySelectable for ExtendedPoint

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl Debug for ExtendedPoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExtendedPoint

Source§

fn default() -> ExtendedPoint

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

impl From<EdwardsPoint> for ExtendedPoint

Source§

fn from(P: EdwardsPoint) -> ExtendedPoint

Converts to this type from the input type.
Source§

impl From<ExtendedPoint> for CachedPoint

Source§

fn from(P: ExtendedPoint) -> CachedPoint

Converts to this type from the input type.
Source§

impl From<ExtendedPoint> for EdwardsPoint

Source§

fn from(P: ExtendedPoint) -> EdwardsPoint

Converts to this type from the input type.
Source§

impl Identity for ExtendedPoint

Source§

fn identity() -> ExtendedPoint

Returns the identity element of the curve. Can be used as a constructor.
Source§

impl Sub<&CachedPoint> for &ExtendedPoint

Source§

fn sub(self, other: &CachedPoint) -> ExtendedPoint

Implement subtraction by negating the point and adding.

Empirically, this seems about the same cost as a custom subtraction impl (maybe because the benefit is cancelled by increased code size?)

Source§

type Output = ExtendedPoint

The resulting type after applying the - operator.
Source§

impl Copy for ExtendedPoint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.