mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-12 16:36:30 +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)) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user