diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-08-04 16:41:01 +0200 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-08-04 17:05:58 +0200 |
commit | b6cebd53fcafd3088fc8361f6d3466166f75410b (patch) | |
tree | a1a3912fb9e91e249e433df0a9b79572f46340f3 /rsa/parallel.py | |
parent | 6760eb76e665dc81863a82110164c4b3b38e7ee9 (diff) | |
download | rsa-git-b6cebd53fcafd3088fc8361f6d3466166f75410b.tar.gz |
Added type annotations + some fixes to get them correct
One functional change: `CryptoOperation.read_infile()` now reads bytes
from `sys.stdin` instead of text. This is necessary to be consistent with
the rest of the code, which all deals with bytes.
Diffstat (limited to 'rsa/parallel.py')
-rw-r--r-- | rsa/parallel.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rsa/parallel.py b/rsa/parallel.py index ef9f07f..e81bcad 100644 --- a/rsa/parallel.py +++ b/rsa/parallel.py @@ -30,7 +30,7 @@ import rsa.prime import rsa.randnum -def _find_prime(nbits, pipe): +def _find_prime(nbits: int, pipe) -> None: while True: integer = rsa.randnum.read_random_odd_int(nbits) @@ -40,7 +40,7 @@ def _find_prime(nbits, pipe): return -def getprime(nbits, poolsize): +def getprime(nbits: int, poolsize: int) -> int: """Returns a prime number that can be stored in 'nbits' bits. Works in multiple threads at the same time. |