pub struct Point { /* private fields */ }Expand description
A point in extended twisted Edwards coordinates.
Implementations§
Source§impl Point
impl Point
Sourcepub fn double(&self) -> Point
pub fn double(&self) -> Point
Point doubling, dbl-2008-hwcd for a = -1.
Adding a point to itself works and was what this did, but the general
addition costs nine multiplications and needs both operands’ T. The
dedicated formula is four multiplications and four squarings, and does
not read T at all – doubling is a function of X, Y and Z alone.
Worth the separate formula because scalar multiplication is doublings almost entirely: the non-adjacent form leaves about forty additions against two hundred and fifty-six doublings.
Sourcepub fn mul_scalar(&self, s: &[u8; 32]) -> Point
pub fn mul_scalar(&self, s: &[u8; 32]) -> Point
Scalar multiplication, constant-time in the scalar.
Every iteration performs a doubling and an addition, selecting between the two results with a conditional move, so the instruction trace is identical for every scalar.