Skip to content

Commit

Permalink
Apply mod p to coordinate verification
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieraykatz committed Apr 3, 2024
1 parent ec7122f commit 452f107
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 452f107

Please sign in to comment.