diff --git a/phpseclib/Math/BigInteger/Engines/PHP32.php b/phpseclib/Math/BigInteger/Engines/PHP32.php index d4987329..27c34acb 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP32.php +++ b/phpseclib/Math/BigInteger/Engines/PHP32.php @@ -82,10 +82,10 @@ class PHP32 extends PHP } $step = count($vals) & 3; if ($step) { - $digit = floor($digit / 2 ** (2 * $step)); + $digit = (int) floor($digit / 2 ** (2 * $step)); } if ($step != 3) { - $digit &= static::MAX_DIGIT; + $digit = (int) fmod($digit, static::BASE_FULL); $i++; } $vals[] = $digit;