mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-25 19:21:09 +00:00
BigInteger: fix bitwise_not for 0
This commit is contained in:
parent
29fabaaa18
commit
a7ebe7d39d
@ -2945,7 +2945,7 @@ class Math_BigInteger
|
||||
// (will always result in a smaller number. ie. ~1 isn't 1111 1110 - it's 0)
|
||||
$temp = $this->toBytes();
|
||||
if ($temp == '') {
|
||||
return '';
|
||||
return $this->_normalize(new Math_BigInteger());
|
||||
}
|
||||
$pre_msb = decbin(ord($temp[0]));
|
||||
$temp = ~$temp;
|
||||
|
Loading…
Reference in New Issue
Block a user