From 4334d381b9f2844aa07c9f9bd7200a3edb83a4de Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 17 Feb 2013 18:53:36 -0600 Subject: [PATCH] BigInteger: E_NOTICE: bitwise_xor and bitwise_or had parameters of array_pad mixed up --- phpseclib/Math/BigInteger.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index c72e7410..17579dcd 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -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);