mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-14 10:53:09 +00:00
BigInteger: speed up powMod() method
This commit is contained in:
parent
862b9662a2
commit
bc8e0ed636
@ -644,6 +644,11 @@ abstract class Engine implements \JsonSerializable
|
||||
return $this->normalize($temp->powModInner($e, $n));
|
||||
}
|
||||
|
||||
if ($this->compare($n) > 0) {
|
||||
list(, $temp) = $this->divide($n);
|
||||
return $temp->powModInner($e, $n);
|
||||
}
|
||||
|
||||
return $this->powModInner($e, $n);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user