diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index bb92c6eae..7747a95b6 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -742,7 +742,7 @@ function getLength() $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 @@ function getLength() */ function getLengthInBytes() { - return ceil($this->getLength() / 8); + return (int) ceil($this->getLength() / 8); } /**