Skip to content

Commit

Permalink
fix: doubling point error for twisted edwards projective
Browse files Browse the repository at this point in the history
  • Loading branch information
advaita-saha committed Sep 21, 2023
1 parent eeb2616 commit b6f4dde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion constantine/math/elliptic/ec_twistededwards_projective.nim
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,11 @@ func double*[Field](

# (B-C-D) => 2X1Y1, but With squaring and 2 substractions instead of mul + addition
# In practice, squaring is not cheap enough to compasate the extra substraction cost.
E.square(P.x)
r.x.prod(P.x, P.y)
r.x.double()

D.square(P.y)
E.square(P.x)
E *= Field.C.getCoefA()

r.y.sum(E, D) # Ry stores F = E+D
Expand Down

0 comments on commit b6f4dde

Please sign in to comment.