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

Definite primality verdict for small numbers #10

Open fjarri opened 1 year ago

fjarri commented 1 year ago

For small enough numbers (e.g. u64) we can have a definite verdict in the same time it takes to run the general BPSW probabilistic test. This may be a sequence of Miller-Rabin tests with predefined bases, or perhaps the Lucas-V test, given how few false positives it has, and the fact that it can be sped up (see #2).