mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 19:54:57 +00:00
PrimeField: fix error with squareRoot method
This commit is contained in:
parent
33fa69b251
commit
ce753669bc
@ -263,7 +263,7 @@ class Integer extends Base
|
|||||||
$r = $this->value->powMod($temp, static::$modulo[$this->instanceID]);
|
$r = $this->value->powMod($temp, static::$modulo[$this->instanceID]);
|
||||||
|
|
||||||
while (!$t->equals($one)) {
|
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)) {
|
if ($t->powMod($two->pow($i), static::$modulo[$this->instanceID])->equals($one)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user