From cc20b7407f6a1407eeba88856fa74f0d1ad31e62 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 30 Jul 2016 11:17:15 -0400 Subject: [PATCH] Applied fixes from StyleCI --- mtproto.php | 2 +- prime.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mtproto.php b/mtproto.php index bdf349b9..02ab8c45 100755 --- a/mtproto.php +++ b/mtproto.php @@ -230,7 +230,7 @@ class Session $server_nonce = $ResPQ['server_nonce']; $public_key_fingerprint = $ResPQ['server_public_key_fingerprints'][0]; $pq_bytes = $ResPQ['pq']; - + $pq = new \phpseclib\Math\BigInteger($pq_bytes, 256); var_dump($this->PrimeModule->primefactors($pq)); die; diff --git a/prime.php b/prime.php index f376b7a9..d5b08685 100644 --- a/prime.php +++ b/prime.php @@ -79,10 +79,10 @@ class PrimeModule $one = new \phpseclib\Math\BigInteger(1); $two = new \phpseclib\Math\BigInteger(2); $three = new \phpseclib\Math\BigInteger(3); - if ($n->powMod($one, $two)->toString() == "0") { + if ($n->powMod($one, $two)->toString() == '0') { return 2; } - if ($n->powMod($one, $three)->toString() == "0") { + if ($n->powMod($one, $three)->toString() == '0') { return 3; } $big = new \phpseclib\Math\BigInteger(); @@ -136,7 +136,7 @@ class PrimeModule if ($limit->compare($checker) == -1) { break; } - while ($n->modPow($one, $checker)->toString() == "0") { + while ($n->modPow($one, $checker)->toString() == '0') { $factors[] = $checker; $n = $n->divide($checker)[0]; $limit = $n->root()->add($one);