From: terrafrost <terrafrost@gmail.com>
Date: Sat, 24 Feb 2024 14:15:49 -0600
Subject: BigInteger: fix getLength()

Origin: backport, https://github.com/phpseclib/phpseclib/commit/c55b75199ec8d12cec6eadf6da99da4a3712fe56
---
 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 3e650b6..82e1029 100644
--- a/phpseclib/Math/BigInteger.php
+++ b/phpseclib/Math/BigInteger.php
@@ -742,7 +742,7 @@ class BigInteger
 
         $max = count($this->value) - 1;
         return $max != -1 ?
-            $max * self::$base + ceil(log($a->value[$max] + 1, 2)) :
+            $max * self::$base + intval(ceil(log($this->value[$max] + 1, 2))) :
             0;
     }
 
@@ -753,7 +753,7 @@ class BigInteger
      */
     function getLengthInBytes()
     {
-        return ceil($this->getLength() / 8);
+        return (int) ceil($this->getLength() / 8);
     }
 
     /**
