Skip to content

Commit

Permalink
BigInteger: update engine preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Jul 8, 2023
1 parent 4013d26 commit 37c6f52
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions phpseclib/Math/BigInteger.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ public static function setEngine($main, array $modexps = ['DefaultEngine'])
/** @var class-string<Engine> $fqmain */
self::$mainEngine = $fqmain;

if (!in_array('Default', $modexps)) {
$modexps[] = 'DefaultEngine';
}

$found = false;
foreach ($modexps as $modexp) {
try {
Expand Down Expand Up @@ -141,9 +137,12 @@ private static function initialize_static_variables()
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 {
Expand Down

0 comments on commit 37c6f52

Please sign in to comment.