1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-14 18:15:39 +01:00
This commit is contained in:
Daniil Gentili 2017-10-06 15:35:59 +03:00
parent 1a730d1fa0
commit 273ad17800
3 changed files with 3 additions and 11 deletions

View File

@ -141,7 +141,6 @@ class BigInteger implements \Serializable
} }
} }
} }
if ($x instanceof self::$mainEngine) { if ($x instanceof self::$mainEngine) {
$this->value = clone $x; $this->value = clone $x;
} elseif ($x instanceof BigInteger\Engines\Engine) { } elseif ($x instanceof BigInteger\Engines\Engine) {
@ -719,4 +718,4 @@ class BigInteger implements \Serializable
{ {
$this->value = clone $this->value; $this->value = clone $this->value;
} }
} }

View File

@ -1036,4 +1036,4 @@ abstract class Engine implements \Serializable
} }
return $max; return $max;
} }
} }

View File

@ -70,13 +70,6 @@ abstract class PHP extends Engine
* @access protected * @access protected
*/ */
const ENGINE_DIR = 'PHP'; const ENGINE_DIR = 'PHP';
/**
* Primes > 2 and < 1000
*
* @var array
*/
protected static $primes;
/** /**
* Default constructor * Default constructor
@ -1279,7 +1272,7 @@ abstract class PHP extends Engine
} }
$value = $this->value; $value = $this->value;
foreach (self::$primes as $prime) { foreach (static::$primes as $prime) {
list(, $r) = self::divide_digit($value, $prime); list(, $r) = self::divide_digit($value, $prime);
if (!$r) { if (!$r) {
return count($value) == 1 && $value[0] == $prime; return count($value) == 1 && $value[0] == $prime;