Skip to content

Commit 46a6de6

Browse files
committed
Use Decaf448 specific addition algorithm
1 parent ff8aeba commit 46a6de6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

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

0 commit comments

Comments
 (0)