PackageTrack
Sign in Get early access

crypto-primes

Random prime number generation and primality checking library

0.7.2 4.5M downloads/mo #4742 most downloaded on crates.io entropyxyz/crypto-primes

What this package is like to depend on

Last release 2 months ago

10 Jun 2026

Release timing varies

gaps range from 8 days to 3 months

Nearly every release is documented

notes for 11 of 11 stable releases

1 version withdrawn

withdrawn after publishing

4 years old

25 releases · first in 2023

11 releases in the last 12 months

see the full history below

Release timeline

25 releases · Jan 2023 to Jun 2026
2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 25
  1. 0.7.2 10 Jun 2026
    Release notes

    Fixed

    • libm dependency removed, the required functions are now vendored. (#122)
    Open source →
  2. 0.7.1 09 Jun 2026
    Release notes

    Added

    • All heap allocation is now gated under the alloc feature (enabled by default). (#118)
    Open source →
  3. 0.7.0 09 Mar 2026
    Release notes

    Changed

    • Bumped crypto-bigint to 0.7.0. (#116)
    Open source →
  4. 0.7.0-pre.9 12 Feb 2026 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint to 0.7.0-rc.27, rand_core to 0.10, and rand to 0.10. (#114)
    Open source →
  5. 0.7.0-pre.8 25 Jan 2026 pre-release
    Release notes

    Changed

    • Bumped rand_core to 0.10.0-rc-7. (#109)
    • Bumped crypto-bigint to 0.7.0-rc.22. (#110)
    Open source →
  6. 0.7.0-pre.7 20 Jan 2026 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint dependency to 0.7.0-rc.21 and rand_core to 0.10.0-rc-5. (#108)
    Open source →
  7. 0.7.0-pre.6 12 Jan 2026 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint dependency to 0.7.0-rc.16. (#106)
    Open source →
  8. 0.7.0-pre.5 03 Jan 2026 pre-release
    Release notes

    Changed

    • Added an add_trial_division_test argument to fips::is_prime(). (#99)
    • fips::is_prime() now takes a FipsOptions structure for additional options. (#101)
    • Bumped crypto-bigint dependency to 0.7.0-rc.13. (#104)

    Added

    • Primality::is_composite(). (#101)
    Open source →
  9. 0.7.0-pre.4 07 Nov 2025 pre-release
    Release notes

    Changed

    • Bumped rand_core to 0.10.0-rc.2 and crypto-bigint to 0.7.0-pre.10. (#95)
    Open source →
  10. 0.7.0-pre.3 13 Sep 2025 pre-release
    Release notes

    Fixed

    • Fixed docs.rs build.
    Open source →
  11. 0.7.0-pre.2 12 Sep 2025 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint dependency to 0.7.0-pre.5. (#91)
    • The crate's methods are now bound on crypto_bigint::Unsigned instead of Integer (#91)
    Open source →
  12. 0.7.0-pre.1 30 May 2025 pre-release
    Release notes

    Changed

    • Replaced the default GMP-style primality check with the BPSW'21 check. (#70)
    • Removed is_prime_with_rng() and is_safe_prime_with_rng() since the primality check is now deterministic. (#70)
    • SieveIterator removed from the public API. (#79)
    • Removed RandomPrimeWithRng trait. (#79)
    • Removed default-rng features and corresponding API items. (#79)
    • Renamed generate_(safe_)prime_with_rng() to random_(safe_)prime(), fips_is_(safe_)prime_with_rng() to fips_is_(safe_)prime(). (#79)
    • Moved multicore functions to multicore module and removed par_ prefixes. (#79)
    • Introduced Flavor enum and removed _safe suffixes from functions. (#79)
    • SieveFactory trait moved to hazmat module. (#79)
    • The base chosen by MillerRabin::test_random_base() can now be equal to 2. (#79)
    • Introudced Error enum; hazmat functions and method now return it instead of panicking. (#79)
    • Renamed SmallPrimesSieveFactory to SmallFactorsSieveFactory. (#79)
    • Moved fips_is_prime() to its own fips submodule and renamed to is_prime. (#79)
    • Bumped crypto-bigint to 0.7.0-pre.1 and MSRV to 1.85. (#80)
    • Bumped crypto-bigint to 0.7.0-pre.2. (#84)
    • Bumped crypto-bigint to 0.7.0-pre.4. (#85)
    • Bumped Rust edition to 2024. (#84)

    Added

    • LucasCheck::Regular (the recommended one from the FIPS-186.5 standard). (#72)
    • hamzat::minimum_mr_iterations() (to calculate the number of MR checks according to the FIPS-186.5 standard). (#72)
    • Add fips_is_prime_with_rng() and fips_is_safe_prime_with_rng(). (#72)
    • Add estimate_primecount() – estimate the number of prime numbers smaller than x. (#81)
    Open source →
  13. 0.7.0-pre.0 22 Feb 2025 pre-release
    Release notes

    Changed

    • Bumped rand-core to 0.9. (#74)
    Open source →
  14. 0.6.2 07 Mar 2025
    Release notes

    Fixed

    • crypto-bigint dependency bumped to 0.6.1.
    Open source →
  15. 0.6.1 17 Feb 2025 withdrawn
    Release notes

    Added

    • Relaxed CryptoRngCore bounds to allow ?Sized. (#76)
    Open source →
  16. 0.6.0 29 Jan 2025
    Release notes

    Changed

    • Renamed Sieve to SmallPrimesSieve. (#64)
    • Bumped crypto-bigint to 0.6.0-rc.7 and MSRV to 1.83. (#67)
    • Bumped crypto-bigint to 0.6. (#68)
    • random_odd_integer() takes an additional SetBits argument. (#69)
    • random_odd_integer() now returns a Result instead of panicking. (#69)

    Added

    • Parallel prime finding methods and a "multicore" feature (#60)
    • Generalized sieving: SieveFactory trait, SieveIterator, and the convenience functions sieve_and_find() and par_sieve_and_find(). (#64)
    Open source →
  17. 0.6.0-pre.2 19 Oct 2024 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint to 0.6.0-rc.6 and MSRV to 1.81. (#55)
    • Switch to binary GCD for improved performance (#54)
    • Remove bit precision from the public API (#46)
    Open source →
  18. 0.6.0-pre.1 04 Oct 2024 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint to 0.6.0-rc.2 (and pinned, since there is a bug introduced in rc.3). (#48)
    Open source →
  19. 0.6.0-pre.0 29 Dec 2023 pre-release
    Release notes

    Changed

    • Bumped crypto-bigint to 0.6.0-pre.7. (#40)
    • Bumped MSRV to 1.73. (#36)
    • MillerRabin::new() takes an Odd-wrapped integer by value. random_odd_uint() returns an Odd-wrapped integer. LucasBase::generate() takes an Odd-wrapped integer. lucas_test takes an Odd-wrapped integer. (#36)
    • random_odd_uint() is renamed to random_odd_integer(), takes a NonZeroU32 for bit_length. (#38)
    • All bit length-type parameters take u32 instead of usize. (#36)
    • All the API is based on the Integer trait instead of Uint specifically. (#38)
    • High-level generation/checking functions take an additional bits_precision argument. (#40)
    Open source →
  20. 0.5.0 21 Aug 2023
    Release notes

    Changed

    • Set and explicit MSRV 1.65 in Cargo.toml. (#31)
    • Set lower bound openssl = 0.10.39. (#31)
    • Set lower bound rand_core = 0.6.4. (#31)
    Open source →
  21. 0.4.1 12 Jul 2023
    Release notes

    Fixed

    • subtle version requirement relaxed to the (implicit) 2.4, instead of technically requiring 2.5 to compile. (#30)
    Open source →
  22. 0.4.0 28 Jun 2023
    Release notes

    Changed

    • The crate is relicensed as Apache-2.0 or MIT, instead of AGPL-v3. (#29)
    • getrandom is not an explicit dependency anymore. This may break builds with the wasm32-unknown-unknown target which relied on crypto-primes enabling the getrandom/js feature. These builds are advised to do it themselves. (#28)

    Fixed

    • Sieve::new() now panics when max_bit_length == 0 (which would lead to incorrect results anyway, so it is not considered a breaking change). (#26)
    • Default preset now uses A* instead of A base selection method for the Lucas test. This does not change the outcomes, but is implemented as a security recommendation. (#26)
    Open source →
  23. 0.3.0 05 May 2023
    Release notes

    Changed

    • sieve_once() was removed (#22).
    • MillerRabin::new() and test_random_base() will panic if the input is invalid. (#22)
    • MillerRabin::check() renamed to test(). (#22)
    • Prime-generating function take Option<usize> instead of usize, where None means the full size of the Uint. (#19)
    • Renamed prime() to generate_prime(), safe_prime() to generate_safe_prime(), prime_with_rng() to generate_prime_with_rng(), safe_prime_with_rng() to generate_safe_prime_with_rng(). (#24)

    Added

    • An alternative propagation method for Lucas sequences improving the performance of lucas_test(). (#20)

    Fixed

    • Some mistakes in the description of Lucas checks (the logic itself was fine). (#20)
    • Major performance increase across the board due to better sieving (especially for random safe prime finding). (#22)
    • Performance increase for the cases when the bit size of the generated prime is smaller than that of the containing Uint. (#19)
    Open source →
  24. 0.2.0 06 Mar 2023
    Release notes

    Changed

    • Bumped MSRV to 1.65 (crypto-bigint requirement). (#18)
    • Bumped crypto-bigint to 0.5 with the corresponding changes in the API. (#13, #18)
    • Sieve::new() now does not panic; if the parameters imply an empty output, that's what the iterator generates. (#14)

    Added

    • RandomPrimeWithRng trait for use in generic code. (#12)

    Fixed

    • Added a gcd(Q, n) == 1 check to the Lucas test. (#11)
    • Added a simple 3 mod 4 check for safe primes, speeding up their generation. (#14)
    • Fixed multiple corner cases in Sieve for small ranges. (#14)
    Open source →
  25. 0.1.0 21 Jan 2023
    Release notes

    Initial release.

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive