From c55b75199ec8d12cec6eadf6da99da4a3712fe56 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 24 Feb 2024 14:15:49 -0600 Subject: [PATCH] BigInteger: fix getLength() --- phpseclib/Math/BigInteger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index e21a5488..a415f192 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -762,7 +762,7 @@ class Math_BigInteger $max = count($this->value) - 1; return $max != -1 ? - $max * MATH_BIGINTEGER_BASE + ceil(log($a->value[$max] + 1, 2)) : + $max * MATH_BIGINTEGER_BASE + intval(ceil(log($this->value[$max] + 1, 2))) : 0; } @@ -773,7 +773,7 @@ class Math_BigInteger */ function getLengthInBytes() { - return ceil($this->getLength() / 8); + return (int) ceil($this->getLength() / 8); } /**