-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gej_add_ge: fix degenerate case when computing P + (-lambda)P
If two points (x1, y1) and (x2, y2) are given to gej_add_ge with x1 != x2 but y1 = -y2, the function gives a wrong answer since this causes it to compute "lambda = 0/0" during an intermediate step. (Here lambda refers to an auxiallary variable in the point addition formula, not the cube-root of 1 used by the endomorphism optimization.) This commit catches the 0/0 and replaces it with an alternate expression for lambda, cmov'ing it in place if necessary.
- Loading branch information
Showing
1 changed file
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters