pub struct EdwardsPoint<F: FieldOps> {
pub x: F,
pub y: F,
}Expand description
An affine point on an Edwards curve, for any characteristic.
Fields§
§x: FThe x coordinate of a point.
y: FThe y coordinate of a point.
Implementations§
Source§impl<F: FieldOps> EdwardsPoint<F>
impl<F: FieldOps> EdwardsPoint<F>
Source§impl<F: FieldOps> EdwardsPoint<F>
impl<F: FieldOps> EdwardsPoint<F>
Sourcepub fn negate(&self, _curve: &EdwardsCurve<F>) -> Self
pub fn negate(&self, _curve: &EdwardsCurve<F>) -> Self
Negate a point.
- Odd char:
-(x, y) = (-x, y) - Char 2:
-(x, y) = (y, x)
Sourcepub fn add(&self, other: &Self, curve: &EdwardsCurve<F>) -> Self
pub fn add(&self, other: &Self, curve: &EdwardsCurve<F>) -> Self
Add two points on the Edwards curve.
Sourcepub fn double(&self, curve: &EdwardsCurve<F>) -> Self
pub fn double(&self, curve: &EdwardsCurve<F>) -> Self
Double a point. Both addition laws are strongly unified, so this
just delegates to add.
Sourcepub fn scalar_mul(&self, k: &[u64], curve: &EdwardsCurve<F>) -> Self
pub fn scalar_mul(&self, k: &[u64], curve: &EdwardsCurve<F>) -> Self
Scalar multiplication [k]P (constant-time double-and-add).
Source§impl<F: FieldOps> EdwardsPoint<F>
impl<F: FieldOps> EdwardsPoint<F>
Sourcepub fn w_diff_add(w1: &F, w2: &F, w3: &F, curve: &EdwardsCurve<F>) -> F
pub fn w_diff_add(w1: &F, w2: &F, w3: &F, curve: &EdwardsCurve<F>) -> F
Differential addition on the w-line (w = x + y, char 2 only).
Given w₁ = w(Q−P), w₂ = w(P), w₃ = w(Q), compute w₅ = w(P+Q).
Sourcepub fn w_double(w2: &F, curve: &EdwardsCurve<F>) -> F
pub fn w_double(w2: &F, curve: &EdwardsCurve<F>) -> F
w-coordinate doubling (w = x + y, char 2 only).
Given w₂ = w(P), compute w₄ = w(2P).
Trait Implementations§
Source§impl<F: Clone + FieldOps> Clone for EdwardsPoint<F>
impl<F: Clone + FieldOps> Clone for EdwardsPoint<F>
Source§fn clone(&self) -> EdwardsPoint<F>
fn clone(&self) -> EdwardsPoint<F>
Returns a duplicate 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<F> ConditionallySelectable for EdwardsPoint<F>
impl<F> ConditionallySelectable for EdwardsPoint<F>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
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 moreSource§impl<F> ConstantTimeEq for EdwardsPoint<F>
impl<F> ConstantTimeEq for EdwardsPoint<F>
Source§impl<F> Display for EdwardsPoint<F>
impl<F> Display for EdwardsPoint<F>
Source§impl<F: FieldOps> PartialEq for EdwardsPoint<F>
impl<F: FieldOps> PartialEq for EdwardsPoint<F>
Source§impl<F: FieldOps> PointOps for EdwardsPoint<F>
impl<F: FieldOps> PointOps for EdwardsPoint<F>
Source§type Curve = EdwardsCurve<F>
type Curve = EdwardsCurve<F>
The elliptic curve we’re working on
Source§fn is_identity(&self) -> bool
fn is_identity(&self) -> bool
Returns true if and only if
self is the identityimpl<F: Copy + FieldOps> Copy for EdwardsPoint<F>
impl<F: FieldOps> Eq for EdwardsPoint<F>
Auto Trait Implementations§
impl<F> Freeze for EdwardsPoint<F>where
F: Freeze,
impl<F> RefUnwindSafe for EdwardsPoint<F>where
F: RefUnwindSafe,
impl<F> Send for EdwardsPoint<F>where
F: Send,
impl<F> Sync for EdwardsPoint<F>where
F: Sync,
impl<F> Unpin for EdwardsPoint<F>where
F: Unpin,
impl<F> UnsafeUnpin for EdwardsPoint<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for EdwardsPoint<F>where
F: UnwindSafe,
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