This commit is contained in:
Daniil Gentili 2016-07-21 11:54:46 +02:00
parent 2b31699ffd
commit 19517be069
3 changed files with 5 additions and 4 deletions

View File

@ -281,7 +281,9 @@ class Session
$public_key_fingerprint = $ResPQ['server_public_key_fingerprints'][0];
$pq_bytes = $ResPQ['pq'];
$pq = bytes_to_long($pq_bytes);
//var_dump($this->PrimeModule->pollard_brent(2118588165281151121));
$opq = new \phpseclib\Math\BigInteger($pq_bytes, 256);
var_dump($pq, $opq->toString()); die;
var_dump($this->PrimeModule->pollard_brent(15));
var_dump($this->PrimeModule->primefactors(1724114033281923457));
var_dump($this->PrimeModule->primefactors(378221), $this->PrimeModule->primefactors(15));
die;

View File

@ -146,9 +146,9 @@ class Session:
pq_bytes = ResPQ['pq']
pq = bytes_to_long(pq_bytes)
# print(prime.pollard_brent(2118588165281151121))
print(prime.primefactors(1724114033281923457))
print(prime.pollard_brent(15))
exit()
print(prime.primefactors(1724114033281923457))
[p, q] = prime.primefactors(pq)
if p > q: (p, q) = (q, p)
assert p*q == pq and p < q

View File

@ -67,7 +67,6 @@ def pollard_brent(n):
x = y
for i in range(r):
y = (pow(y, 2, n) + c) % n
print(y)
k = 0
while k < r and g==1: