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

Consistent prime number generation #25

Open fjarri opened 1 year ago

fjarri commented 1 year ago

For some applications where a prime is generated as an output of some hash, it is important to make sure that the same prime number is produced given the same RNG state. We need to add a test with some pre-generated primes with given RNG states, and make sure that when that test detects a change, it is either reverted, or considered a breaking change in the crate.

kayabaNerve commented 7 months ago

Why isn't this outsourced to calling generate_prime_with_rng where the passed in RNG is seeded?

fjarri commented 7 months ago

It's not about being consistent within the same version of the library (which is the case now), but about being consistent within the same major version.

kayabaNerve commented 7 months ago

Ah, thanks for the clarification. Agreed on the value of that.