entropyxyz / crypto-primes

Random prime generation and primality testing library based on `crypto-bigint`.
https://docs.rs/crypto-primes
Apache License 2.0
17 stars 4 forks source link

Parallel random number generation #32

Open fjarri opened 10 months ago

fjarri commented 10 months ago

Generation of random primes can be sped up by parallelizing. On the implementation side, there are two possibilities:

A more complicated part is the API. How do we expose that in the most async-runtime-agnostic way? The parallel tasks will need to take some kind of a signal object as an argument, so that they could be terminated when one task finds a prime. The stop points could even be checked on every internal Miller-Rabin iteration (that is, in-between every modular exponentiation there).