diff --git a/phpseclib/Math/BigInteger/Engines/GMP.php b/phpseclib/Math/BigInteger/Engines/GMP.php index 148492de..72ec98ad 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP.php +++ b/phpseclib/Math/BigInteger/Engines/GMP.php @@ -136,8 +136,10 @@ class GMP extends Engine { switch (abs($base)) { case 256: - $sign = $this->is_negative ? '-' : ''; $this->value = gmp_import($this->value); + if ($this->is_negative) { + $this->value = -$this->value; + } break; case 16: $temp = $this->is_negative ? '-0x' . $this->value : '0x' . $this->value;