Cleaned up RSA class
This commit is contained in:
parent
e6093e65ac
commit
caa05510a0
@ -14,21 +14,21 @@ namespace danog\MadelineProto;
|
|||||||
|
|
||||||
class RSA extends TL\TL
|
class RSA extends TL\TL
|
||||||
{
|
{
|
||||||
public $key; // phpseclib\Crypt\RSA class
|
|
||||||
public $n; // phpseclib\Math\BigInteger class
|
public $n; // phpseclib\Math\BigInteger class
|
||||||
public $e; // phpseclib\Math\BigInteger class
|
public $e; // phpseclib\Math\BigInteger class
|
||||||
public $fp; // phpseclib\Math\BigInteger class
|
public $fp; // phpseclib\Math\BigInteger class
|
||||||
public $fp_bytes; // bytes
|
public $fp_bytes; // bytes
|
||||||
|
|
||||||
public function __construct($key)
|
public function __construct($rsa_key)
|
||||||
{
|
{
|
||||||
\danog\MadelineProto\Logger::log('Istantiating \phpseclib\Crypt\RSA...');
|
\danog\MadelineProto\Logger::log('Istantiating \phpseclib\Crypt\RSA...');
|
||||||
$this->key = new \phpseclib\Crypt\RSA();
|
$key = new \phpseclib\Crypt\RSA();
|
||||||
|
|
||||||
\danog\MadelineProto\Logger::log('Loading key...');
|
\danog\MadelineProto\Logger::log('Loading key...');
|
||||||
$this->key->loadKey($key);
|
$key->loadKey($rsa_key);
|
||||||
$this->n = $this->key->modulus;
|
$this->n = $key->modulus;
|
||||||
$this->e = $this->key->exponent;
|
$this->e = $key->exponent;
|
||||||
|
unset($key);
|
||||||
|
|
||||||
\danog\MadelineProto\Logger::log('Computing fingerprint...');
|
\danog\MadelineProto\Logger::log('Computing fingerprint...');
|
||||||
$this->fp_bytes = substr(
|
$this->fp_bytes = substr(
|
||||||
|
Loading…
Reference in New Issue
Block a user