mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 18:55:13 +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()
|
||||
{
|
||||
$length = static::$modulo[$this->instanceID]->getLengthInBytes();
|
||||
return str_pad($this->value->toBytes(), $length, "\0", STR_PAD_LEFT);
|
||||
if (isset(static::$modulo[$this->instanceID])) {
|
||||
$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