forked from visoftsolutions/noir_rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cycle_group validate_is_on_curve bug (AztecProtocol#4494)
Fixes the validate_is_on_curve function in cycle_group. Previously this code would incorrectly succeed given a point that wasn't on a curve. It multiplied by a boolean `is_point_at_infinity()`, which for normal points, was false or 0, which set res to 0, thereby passing the following check that res was 0. If a point was marked as the point at infinity, then is_point_at_infinity() would be true or 1, and this would incorrect fail even though the point was the point at infinity. The fix is simple - reverse when we multiply by 1 and when we multiply by 0. This will now correctly multiply by 0 when the point is marked as the point at infinity, and also correctly multiply by 1 when the point is not marked as infinity. --------- Co-authored-by: Innokentii Sennovskii <isennovskiy@gmail.com>
- Loading branch information
1 parent
ba62827
commit 61af90c
Showing
3 changed files
with
62 additions
and
6 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
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
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