1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-30 04:39:02 +01:00

BigInteger: E_NOTICE: bitwise_xor and bitwise_or had parameters of array_pad mixed up

This commit is contained in:
terrafrost 2013-02-17 18:53:36 -06:00
parent 60b66e3726
commit 4334d381b9

View File

@ -2759,7 +2759,7 @@ class Math_BigInteger {
$result->value = array_slice($result->value, 0, $length); $result->value = array_slice($result->value, 0, $length);
for ($i = 0; $i < $length; ++$i) { 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); return $this->_normalize($result);
@ -2795,11 +2795,11 @@ class Math_BigInteger {
$length = max(count($this->value), count($x->value)); $length = max(count($this->value), count($x->value));
$result = $this->copy(); $result = $this->copy();
$result->value = array_pad($result->value, 0, $length); $result->value = array_pad($result->value, $length, 0);
$x->value = array_pad($x->value, 0, $length); $x->value = array_pad($x->value, $length, 0);
for ($i = 0; $i < $length; ++$i) { 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); return $this->_normalize($result);
@ -2835,11 +2835,11 @@ class Math_BigInteger {
$length = max(count($this->value), count($x->value)); $length = max(count($this->value), count($x->value));
$result = $this->copy(); $result = $this->copy();
$result->value = array_pad($result->value, 0, $length); $result->value = array_pad($result->value, $length, 0);
$x->value = array_pad($x->value, 0, $length); $x->value = array_pad($x->value, $length, 0);
for ($i = 0; $i < $length; ++$i) { 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); return $this->_normalize($result);