Skip to content

Commit

Permalink
PrimeField: fix error with squareRoot method
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Oct 31, 2023
1 parent 33fa69b commit ce75366
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phpseclib/Math/PrimeField/Integer.php
Expand Up @@ -263,7 +263,7 @@ public function squareRoot()
$r = $this->value->powMod($temp, static::$modulo[$this->instanceID]);

while (!$t->equals($one)) {
for ($i == clone $one; $i->compare($m) < 0; $i = $i->add($one)) {
for ($i = clone $one; $i->compare($m) < 0; $i = $i->add($one)) {
if ($t->powMod($two->pow($i), static::$modulo[$this->instanceID])->equals($one)) {
break;
}
Expand Down

0 comments on commit ce75366

Please sign in to comment.