Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect check that point is not identity element #65

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply mod p to coordinate verification
  • Loading branch information
stevieraykatz committed Apr 3, 2024
commit 452f107ce08e247ca9fefeaa54bbcf51097a260a
2 changes: 1 addition & 1 deletion solidity/src/FCL_elliptic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function SqrtMod(uint256 self) internal view returns (uint256 result){
* @dev Check if a point in affine coordinates is on the curve (reject Neutral that is indeed on the curve).
*/
function ecAff_isOnCurve(uint256 x, uint256 y) internal pure returns (bool) {
if ( ((0 == x)&&( 0 == y)) || (x == p && y == p)) {
if ((0 == x % p) && (0 == y % p)) {
return false;
}
unchecked {
Expand Down
Loading