Skip to content

Commit

Permalink
Merge pull request #61 from stevieraykatz/fixInfiniteLoop
Browse files Browse the repository at this point in the history
Add additional check to avoid infinite loop
  • Loading branch information
rdubois-crypto authored Feb 29, 2024
2 parents 027cb87 + 6d3c9e8 commit ec7122f
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 @@ -363,7 +363,7 @@ function SqrtMod(uint256 self) internal view returns (uint256 result){
{
scalar_u=addmod(scalar_u, n-scalar_v, n);
scalar_v=0;

if (scalar_u == 0 && scalar_v == 0) return 0;
}
assembly {
for { let T4 := add(shl(1, and(shr(index, scalar_v), 1)), and(shr(index, scalar_u), 1)) } eq(T4, 0) {
Expand Down

0 comments on commit ec7122f

Please sign in to comment.