mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-27 00:58:25 +00:00
Merge branch 'master' into php5
* master: BigInteger: fix previous fix BigInteger: small optimization to bitwise_not
This commit is contained in:
commit
c59750562a
@ -2876,7 +2876,7 @@ class BigInteger
|
|||||||
$leading_ones = chr((1 << ($new_bits & 0x7)) - 1) . str_repeat(chr(0xFF), $new_bits >> 3);
|
$leading_ones = chr((1 << ($new_bits & 0x7)) - 1) . str_repeat(chr(0xFF), $new_bits >> 3);
|
||||||
$this->_base256_lshift($leading_ones, $current_bits);
|
$this->_base256_lshift($leading_ones, $current_bits);
|
||||||
|
|
||||||
$temp = str_pad($temp, ceil(strlen($this->toBits()) / 8), chr(0), STR_PAD_LEFT);
|
$temp = str_pad($temp, strlen($leading_ones), chr(0), STR_PAD_LEFT);
|
||||||
|
|
||||||
return $this->_normalize(new static($leading_ones | $temp, 256));
|
return $this->_normalize(new static($leading_ones | $temp, 256));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user