We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff8aeba commit 46a6de6Copy full SHA for 46a6de6
1 file changed
ed448-goldilocks/src/curve/twedwards/extended.rs
@@ -78,11 +78,11 @@ impl ExtendedPoint {
78
/// Returns an extensible point
79
/// (3.1) https://iacr.org/archive/asiacrypt2008/53500329/53500329.pdf
80
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;
+ let A = (self.Y - self.X) * (other.Y - other.X);
+ let B = (self.Y + self.X) * (other.Y + other.X);
+ let C = FieldElement::TWO_TIMES_TWISTED_D * self.T * other.T;
+ let D = (self.Z * other.Z).double();
+ let E = B - A;
86
let F = D - C;
87
let G = D + C;
88
let H = B + A;
0 commit comments