From 5c0dae278233d3bc48c03a0d9d8270ab840ba9d9 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 4 Aug 2016 19:03:45 -0400 Subject: [PATCH] Fix --- mtproto.php | 2 +- prime.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mtproto.php b/mtproto.php index 02ab8c45..af99fdda 100755 --- a/mtproto.php +++ b/mtproto.php @@ -19,7 +19,7 @@ function newcrc32($data) /** * Function to dump the hex version of a string. - * :param what: What to dump. + * @param $what What to dump. */ function hex_dump(...$what) { diff --git a/prime.php b/prime.php index ce3701d3..5c4fed13 100644 --- a/prime.php +++ b/prime.php @@ -73,7 +73,7 @@ class PrimeModule return true; } // taken from https://github.com/enricostara/telegram-mt-node/blob/master/lib/security/pq-finder.js - public function factorization($pq) { + public function getpq($pq) { $zero = new \phpseclib\Math\BigInteger(0); $one = new \phpseclib\Math\BigInteger(1); $two = new \phpseclib\Math\BigInteger(2); @@ -121,7 +121,7 @@ class PrimeModule $q = $pq->divide(prime)[0]; } $_pq = ($q->compare($p) > 0) ? [$p, $q] : [$q, $p]; - return _$pq; + return $_pq; } public function pollard_brent($n) { @@ -179,7 +179,7 @@ class PrimeModule { $factors = []; $n = new \phpseclib\Math\BigInteger(1724114033281923457); -var_dump($this->factorization($n)); +var_dump($this->getpq($n)); $one = new \phpseclib\Math\BigInteger(1); $two = new \phpseclib\Math\BigInteger(2); $limit = $n->root()->add($one);