mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-04 12:58:28 +00:00
- fix potential E_NOTICE in modInverse (thanks bantu!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@183 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
cfcf20cce5
commit
a1f3ee7b69
@ -2328,13 +2328,13 @@ class Math_BigInteger {
|
||||
$one = new Math_BigInteger(1);
|
||||
}
|
||||
|
||||
// $x mod $n == $x mod -$n.
|
||||
// $x mod -$n == $x mod $n.
|
||||
$n = $n->abs();
|
||||
|
||||
if ($this->compare($zero) < 0) {
|
||||
$temp = $this->abs();
|
||||
$temp = $temp->modInverse($n);
|
||||
return $negated === false ? false : $this->_normalize($n->subtract($temp));
|
||||
return $this->_normalize($n->subtract($temp));
|
||||
}
|
||||
|
||||
extract($this->extendedGCD($n));
|
||||
|
Loading…
x
Reference in New Issue
Block a user