- 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:
Jim Wigginton 2011-11-07 02:27:01 +00:00
parent cfcf20cce5
commit a1f3ee7b69

View File

@ -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));