summaryrefslogtreecommitdiff
path: root/rsa/parallel.py
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2019-08-04 16:41:01 +0200
committerSybren A. Stüvel <sybren@stuvel.eu>2019-08-04 17:05:58 +0200
commitb6cebd53fcafd3088fc8361f6d3466166f75410b (patch)
treea1a3912fb9e91e249e433df0a9b79572f46340f3 /rsa/parallel.py
parent6760eb76e665dc81863a82110164c4b3b38e7ee9 (diff)
downloadrsa-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.py4
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.