aboutsummaryrefslogtreecommitdiff
path: root/rsa/parallel.py
diff options
context:
space:
mode:
Diffstat (limited to 'rsa/parallel.py')
-rw-r--r--rsa/parallel.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/rsa/parallel.py b/rsa/parallel.py
index a3fe312..f9afedb 100644
--- a/rsa/parallel.py
+++ b/rsa/parallel.py
@@ -1,5 +1,3 @@
-# -*- coding: utf-8 -*-
-#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,16 +22,14 @@ Introduced in Python-RSA 3.1.
"""
-from __future__ import print_function
-
import multiprocessing as mp
+from multiprocessing.connection import Connection
-from rsa._compat import range
import rsa.prime
import rsa.randnum
-def _find_prime(nbits, pipe):
+def _find_prime(nbits: int, pipe: Connection) -> None:
while True:
integer = rsa.randnum.read_random_odd_int(nbits)
@@ -43,7 +39,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.