From 273ad1780045e7601bd41fbab4fa3b5035a1b2bd Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 6 Oct 2017 15:35:59 +0300 Subject: [PATCH] Bugfix --- phpseclib/Math/BigInteger.php | 3 +-- phpseclib/Math/BigInteger/Engines/Engine.php | 2 +- phpseclib/Math/BigInteger/Engines/PHP.php | 9 +-------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index bcc99e10..1c00b8a2 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -141,7 +141,6 @@ class BigInteger implements \Serializable } } } - if ($x instanceof self::$mainEngine) { $this->value = clone $x; } elseif ($x instanceof BigInteger\Engines\Engine) { @@ -719,4 +718,4 @@ class BigInteger implements \Serializable { $this->value = clone $this->value; } -} \ No newline at end of file +} diff --git a/phpseclib/Math/BigInteger/Engines/Engine.php b/phpseclib/Math/BigInteger/Engines/Engine.php index 3abdbc65..151f3b90 100644 --- a/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/phpseclib/Math/BigInteger/Engines/Engine.php @@ -1036,4 +1036,4 @@ abstract class Engine implements \Serializable } return $max; } -} \ No newline at end of file +} diff --git a/phpseclib/Math/BigInteger/Engines/PHP.php b/phpseclib/Math/BigInteger/Engines/PHP.php index feeeb65b..f437f2d6 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/phpseclib/Math/BigInteger/Engines/PHP.php @@ -70,13 +70,6 @@ abstract class PHP extends Engine * @access protected */ const ENGINE_DIR = 'PHP'; - - /** - * Primes > 2 and < 1000 - * - * @var array - */ - protected static $primes; /** * Default constructor @@ -1279,7 +1272,7 @@ abstract class PHP extends Engine } $value = $this->value; - foreach (self::$primes as $prime) { + foreach (static::$primes as $prime) { list(, $r) = self::divide_digit($value, $prime); if (!$r) { return count($value) == 1 && $value[0] == $prime;