mirror of
https://github.com/danog/tgseclib.git
synced 2024-11-27 04:34:45 +01:00
BigInteger: E_NOTICE: bitwise_xor and bitwise_or had parameters of array_pad mixed up
This commit is contained in:
parent
60b66e3726
commit
4334d381b9
@ -2759,7 +2759,7 @@ class Math_BigInteger {
|
||||
$result->value = array_slice($result->value, 0, $length);
|
||||
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$result->value[$i] = $result->value[$i] & $x->value[$i];
|
||||
$result->value[$i]&= $x->value[$i];
|
||||
}
|
||||
|
||||
return $this->_normalize($result);
|
||||
@ -2795,11 +2795,11 @@ class Math_BigInteger {
|
||||
|
||||
$length = max(count($this->value), count($x->value));
|
||||
$result = $this->copy();
|
||||
$result->value = array_pad($result->value, 0, $length);
|
||||
$x->value = array_pad($x->value, 0, $length);
|
||||
$result->value = array_pad($result->value, $length, 0);
|
||||
$x->value = array_pad($x->value, $length, 0);
|
||||
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$result->value[$i] = $this->value[$i] | $x->value[$i];
|
||||
$result->value[$i]|= $x->value[$i];
|
||||
}
|
||||
|
||||
return $this->_normalize($result);
|
||||
@ -2835,11 +2835,11 @@ class Math_BigInteger {
|
||||
|
||||
$length = max(count($this->value), count($x->value));
|
||||
$result = $this->copy();
|
||||
$result->value = array_pad($result->value, 0, $length);
|
||||
$x->value = array_pad($x->value, 0, $length);
|
||||
$result->value = array_pad($result->value, $length, 0);
|
||||
$x->value = array_pad($x->value, $length, 0);
|
||||
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$result->value[$i] = $this->value[$i] ^ $x->value[$i];
|
||||
$result->value[$i]^= $x->value[$i];
|
||||
}
|
||||
|
||||
return $this->_normalize($result);
|
||||
|
Loading…
Reference in New Issue
Block a user