pub struct KummerPoint<F: FieldOps + Copy> {
pub x: F,
pub z: F,
}Expand description
A point on the Kummer line of a Montgomery curve, represented by (X : Z).
The affine x-coordinate is x = X / Z when Z ≠ 0.
A conventional choice is:
(1 : 0)for the identity image,(X : Z)withZ ≠ 0for finite x-coordinates.
Fields§
§x: FProjective x coordinate
z: FProjective z coordinate
Implementations§
Source§impl<F: FieldOps> KummerPoint<F>
impl<F: FieldOps> KummerPoint<F>
Sourcepub fn from_x(x: F) -> Self
pub fn from_x(x: F) -> Self
Construct the finite x-line point corresponding to the affine
x-coordinate x, i.e. (x : 1).
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Return true if this point is the image of identity.
Source§impl<F: FieldOps + Copy> KummerPoint<F>
impl<F: FieldOps + Copy> KummerPoint<F>
Sourcepub fn xdouble(&self, curve: &MontgomeryCurve<F>) -> Self
pub fn xdouble(&self, curve: &MontgomeryCurve<F>) -> Self
Point doubling on the Kummer line.
Given x(P) in projective form (X:Z), compute x([2]P).
Sourcepub fn xadd(&self, other: &Self, diff: &Self) -> Self
pub fn xadd(&self, other: &Self, diff: &Self) -> Self
Differential addition. Given (in projective form (X:Z)):
self = x(P),other = x(Q),diff = x(P - Q),
compute x(P + Q).
Sourcepub fn scalar_mul(&self, k: &[u64], curve: &MontgomeryCurve<F>) -> Self
pub fn scalar_mul(&self, k: &[u64], curve: &MontgomeryCurve<F>) -> Self
Montgomery ladder for scalar multiplication.
Given an x-line point x(P) and a scalar k, compute x([k]P).
The scalar k is given as a slice of u64 limbs in little-endian
order (same convention as FieldOps::pow).
Trait Implementations§
Source§impl<F: Clone + FieldOps + Copy> Clone for KummerPoint<F>
impl<F: Clone + FieldOps + Copy> Clone for KummerPoint<F>
Source§fn clone(&self) -> KummerPoint<F>
fn clone(&self) -> KummerPoint<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F> ConditionallySelectable for KummerPoint<F>
impl<F> ConditionallySelectable for KummerPoint<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)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<F> ConstantTimeEq for KummerPoint<F>
impl<F> ConstantTimeEq for KummerPoint<F>
Source§impl<F> Display for KummerPoint<F>
impl<F> Display for KummerPoint<F>
Source§impl<F> PartialEq for KummerPoint<F>where
F: FieldOps + ConstantTimeEq,
impl<F> PartialEq for KummerPoint<F>where
F: FieldOps + ConstantTimeEq,
Source§impl<F> PointOps for KummerPoint<F>
impl<F> PointOps for KummerPoint<F>
Source§fn is_identity(&self) -> bool
fn is_identity(&self) -> bool
Return true if this is the identity image.
Source§fn negate(&self, _curve: &Self::Curve) -> Self
fn negate(&self, _curve: &Self::Curve) -> Self
Negation is trivial on the Kummer line because P and -P have the
same image.
Source§fn scalar_mul(&self, k: &[u64], curve: &Self::Curve) -> Self
fn scalar_mul(&self, k: &[u64], curve: &Self::Curve) -> Self
Scalar multiplication is naturally implemented by the Montgomery ladder.