Skip to content

Commit fca9b39

Browse files
committed
Use Decaf448 specific addition algorithm
1 parent bcc2f0b commit fca9b39

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ed448-goldilocks/src/curve/twedwards/extensible.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ impl ExtensiblePoint {
7676
/// Returns an extensible point
7777
/// (3.1) https://iacr.org/archive/asiacrypt2008/53500329/53500329.pdf
7878
pub fn add_extended(&self, other: &ExtendedPoint) -> ExtensiblePoint {
79-
let A = self.X * other.X;
80-
let B = self.Y * other.Y;
81-
let C = self.T1 * self.T2 * other.T * FieldElement::TWISTED_D;
82-
let D = self.Z * other.Z;
83-
let E = (self.X + self.Y) * (other.X + other.Y) - A - B;
79+
let A = (self.Y - self.X) * (other.Y - other.X);
80+
let B = (self.Y + self.X) * (other.Y + other.X);
81+
let C = FieldElement::TWO_TIMES_TWISTED_D * self.T1 * self.T2 * other.T;
82+
let D = (self.Z * other.Z).double();
83+
let E = B - A;
8484
let F = D - C;
8585
let G = D + C;
8686
let H = B + A;

0 commit comments

Comments
 (0)