diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index 70491abd..66d8097b 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -100,10 +100,6 @@ class BigInteger implements \JsonSerializable /** @var class-string $fqmain */ self::$mainEngine = $fqmain; - if (!in_array('Default', $modexps)) { - $modexps[] = 'DefaultEngine'; - } - $found = false; foreach ($modexps as $modexp) { try { @@ -141,9 +137,12 @@ class BigInteger implements \JsonSerializable if (!isset(self::$mainEngine)) { $engines = [ ['GMP'], - ['PHP64', ['OpenSSL']], ['BCMath', ['OpenSSL']], - ['PHP32', ['OpenSSL']] + ['PHP64', ['OpenSSL']], + ['PHP32', ['OpenSSL']], + ['PHP64', ['DefaultEngine']], + ['PHP32', ['DefaultEngine']], + ['BCMath', ['DefaultEngine']] ]; foreach ($engines as $engine) { try {