From 615d6cfc7cf40d61bdaa9653c6a4118c6be3cf06 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Thu, 31 Aug 2023 09:28:16 -0500 Subject: [PATCH] BigInteger: fix more PHP32-bit errors --- phpseclib/Math/BigInteger/Engines/PHP32.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Math/BigInteger/Engines/PHP32.php b/phpseclib/Math/BigInteger/Engines/PHP32.php index 964cd170..18f78cdb 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP32.php +++ b/phpseclib/Math/BigInteger/Engines/PHP32.php @@ -80,10 +80,10 @@ class PHP32 extends PHP } $step = count($vals) & 3; if ($step) { - $digit = floor($digit / pow(2, 2 * $step)); + $digit = (int) floor($digit / pow(2, 2 * $step)); } if ($step != 3) { - $digit &= static::MAX_DIGIT; + $digit = (int) fmod($digit, static::BASE_FULL); $i++; } $vals[] = $digit;