entropyxyz/crypto-primes

More descriptive return type for primality checks

fjarri opened this issue · 1 comments

Currently the primality checking functions return bool, which may occasionally be confusing, and also does not distinguish between "definitely prime" and "probably prime" (although with the intended usage of this library, the former would be pretty rare, since we can only tell that during the trial division phase). Should we instead follow num-prime and return an enum like Primality?

Added in d6b7d42 for hazmat functions. The ones in presets will continue to return bool because the idea of presets is that it contains a vetted sequence of checks that is supposed to be trusted.