mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-14 09:24:07 +00:00
BigInteger/GMP: negative base-256 numbers didn't load correctly
This commit is contained in:
parent
114dc17f5b
commit
31c10f39e5
@ -136,8 +136,10 @@ class GMP extends Engine
|
|||||||
{
|
{
|
||||||
switch (abs($base)) {
|
switch (abs($base)) {
|
||||||
case 256:
|
case 256:
|
||||||
$sign = $this->is_negative ? '-' : '';
|
|
||||||
$this->value = gmp_import($this->value);
|
$this->value = gmp_import($this->value);
|
||||||
|
if ($this->is_negative) {
|
||||||
|
$this->value = -$this->value;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
$temp = $this->is_negative ? '-0x' . $this->value : '0x' . $this->value;
|
$temp = $this->is_negative ? '-0x' . $this->value : '0x' . $this->value;
|
||||||
|
Loading…
Reference in New Issue
Block a user