Struct salty::EdwardsPoint

source ·
pub struct EdwardsPoint(/* private fields */);
Expand description

These represent the (X,Y,Z,T) coordinates

Implementations§

source§

impl EdwardsPoint

source

pub fn basepoint() -> EdwardsPoint

source

pub fn neutral_element() -> EdwardsPoint

source

pub fn compressed(&self) -> CompressedY

source

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.

source

pub fn x(&self) -> FieldElement

The x-coordinate of the point

source

pub fn y(&self) -> FieldElement

The y-coordinate of the point

source

pub fn u(&self) -> FieldElement

The u-coordinate of the X25519 point

Trait Implementations§

source§

impl<'a, 'b> Add<&'b EdwardsPoint> for &'a EdwardsPoint

§

type Output = EdwardsPoint

The resulting type after applying the + operator.
source§

fn add(self, other: &'b EdwardsPoint) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for EdwardsPoint

source§

fn clone(&self) -> EdwardsPoint

Returns a copy 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 EdwardsPoint

source§

fn conditional_select(p: &Self, q: &Self, choice: Choice) -> Self

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

fn conditional_swap(p: &mut Self, q: &mut Self, choice: Choice)

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

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

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

impl ConstantTimeEq for EdwardsPoint

source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
source§

impl Debug for EdwardsPoint

source§

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

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

impl Default for EdwardsPoint

source§

fn default() -> EdwardsPoint

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

impl<'a, 'b> Mul<&'b EdwardsPoint> for &'a Scalar

§

type Output = EdwardsPoint

The resulting type after applying the * operator.
source§

fn mul(self, point: &'b EdwardsPoint) -> EdwardsPoint

Performs the * operation. Read more
source§

impl<'a> Neg for &'a EdwardsPoint

§

type Output = EdwardsPoint

The resulting type after applying the - operator.
source§

fn neg(self) -> EdwardsPoint

Performs the unary - operation. Read more
source§

impl PartialEq for EdwardsPoint

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for EdwardsPoint

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> ConditionallyNegatable for Twhere T: ConditionallySelectable, &'a T: for<'a> Neg<Output = T>,

source§

fn conditional_negate(&mut self, choice: Choice)

Negate self if choice == Choice(1); otherwise, leave it unchanged. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.