mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-15 17:57:12 +00:00
Math/PrimeField: fix for when garbage collection has wiped data
This commit is contained in:
parent
69325956ce
commit
25a06f0071
@ -312,8 +312,11 @@ class Integer extends Base
|
|||||||
*/
|
*/
|
||||||
public function toBytes()
|
public function toBytes()
|
||||||
{
|
{
|
||||||
$length = static::$modulo[$this->instanceID]->getLengthInBytes();
|
if (isset(static::$modulo[$this->instanceID])) {
|
||||||
return str_pad($this->value->toBytes(), $length, "\0", STR_PAD_LEFT);
|
$length = static::$modulo[$this->instanceID]->getLengthInBytes();
|
||||||
|
return str_pad($this->value->toBytes(), $length, "\0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
return $this->value->toBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user