mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-14 01:14:08 +00:00
BigInteger/PHP: make sure that zero is represented uniformly
This commit is contained in:
parent
d4b0e00d14
commit
011f6ad200
@ -108,6 +108,10 @@ abstract class PHP extends Engine
|
||||
while (strlen($x)) {
|
||||
$this->value[] = self::bytes2int(self::base256_rshift($x, static::BASE));
|
||||
}
|
||||
|
||||
if ($this->value == [0]) {
|
||||
$this->value = [];
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
$x = (strlen($this->value) & 1) ? '0' . $this->value : $this->value;
|
||||
|
Loading…
Reference in New Issue
Block a user