summaryrefslogtreecommitdiff
path: root/paramiko/primes.py
diff options
context:
space:
mode:
authorDorian Pula <dorian.pula@amber-penguin-software.ca>2017-05-30 12:02:17 -0400
committerJeff Forcier <jeff@bitprophet.org>2017-05-31 17:14:40 -0700
commitecb297518267487853813109da946d7240d717e1 (patch)
tree9974aecc603adad39e6bb88034c08dd74d91340e /paramiko/primes.py
parent98f682815cdd33a2f1999b931582e2467bb59754 (diff)
downloadparamiko-ecb297518267487853813109da946d7240d717e1.tar.gz
Additional PEP8 fixes.
Diffstat (limited to 'paramiko/primes.py')
-rw-r--r--paramiko/primes.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/paramiko/primes.py b/paramiko/primes.py
index d0e17575..50100ad5 100644
--- a/paramiko/primes.py
+++ b/paramiko/primes.py
@@ -25,7 +25,7 @@ import os
from paramiko import util
from paramiko.py3compat import byte_mask, long
from paramiko.ssh_exception import SSHException
-from paramiko.common import *
+from paramiko.common import * # noqa
def _roll_random(n):
@@ -62,7 +62,8 @@ class ModulusPack (object):
self.discarded = []
def _parse_modulus(self, line):
- timestamp, mod_type, tests, tries, size, generator, modulus = line.split()
+ timestamp, mod_type, tests, tries, size, generator, modulus = \
+ line.split()
mod_type = int(mod_type)
tests = int(tests)
tries = int(tries)
@@ -74,8 +75,10 @@ class ModulusPack (object):
# type 2 (meets basic structural requirements)
# test 4 (more than just a small-prime sieve)
# tries < 100 if test & 4 (at least 100 tries of miller-rabin)
- if (mod_type < 2) or (tests < 4) or ((tests & 4) and (tests < 8) and (tries < 100)):
- self.discarded.append((modulus, 'does not meet basic requirements'))
+ if (mod_type < 2) or (tests < 4) or \
+ ((tests & 4) and (tests < 8) and (tries < 100)):
+ self.discarded.append(
+ (modulus, 'does not meet basic requirements'))
return
if generator == 0:
generator = 2
@@ -85,7 +88,8 @@ class ModulusPack (object):
# this is okay.
bl = util.bit_length(modulus)
if (bl != size) and (bl != size + 1):
- self.discarded.append((modulus, 'incorrectly reported bit length %d' % size))
+ self.discarded.append(
+ (modulus, 'incorrectly reported bit length %d' % size))
return
if bl not in self.pack:
self.pack[bl] = []