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
Releases
latest 25-
0.7.210 Jun 2026Release notes
Open source →Fixed
libmdependency removed, the required functions are now vendored. (#122)
-
0.7.109 Jun 2026Release notes
Open source →Added
- All heap allocation is now gated under the
allocfeature (enabled by default). (#118)
- All heap allocation is now gated under the
-
0.7.009 Mar 2026 -
0.7.0-pre.912 Feb 2026 pre-releaseRelease notes
Open source →Changed
- Bumped
crypto-bigintto 0.7.0-rc.27,rand_coreto 0.10, andrandto 0.10. (#114)
- Bumped
-
0.7.0-pre.825 Jan 2026 pre-releaseRelease notes
Open source → -
0.7.0-pre.720 Jan 2026 pre-releaseRelease notes
Open source →Changed
- Bumped
crypto-bigintdependency to 0.7.0-rc.21 andrand_coreto 0.10.0-rc-5. (#108)
- Bumped
-
0.7.0-pre.612 Jan 2026 pre-release -
0.7.0-pre.503 Jan 2026 pre-releaseRelease notes
Open source →Changed
- Added an
add_trial_division_testargument tofips::is_prime(). (#99) fips::is_prime()now takes aFipsOptionsstructure for additional options. (#101)- Bumped
crypto-bigintdependency to 0.7.0-rc.13. (#104)
Added
Primality::is_composite(). (#101)
- Added an
-
0.7.0-pre.407 Nov 2025 pre-releaseRelease notes
Open source →Changed
- Bumped
rand_coreto 0.10.0-rc.2 andcrypto-bigintto 0.7.0-pre.10. (#95)
- Bumped
-
0.7.0-pre.313 Sep 2025 pre-release -
0.7.0-pre.212 Sep 2025 pre-release -
0.7.0-pre.130 May 2025 pre-releaseRelease notes
Open source →Changed
- Replaced the default GMP-style primality check with the BPSW'21 check. (#70)
- Removed
is_prime_with_rng()andis_safe_prime_with_rng()since the primality check is now deterministic. (#70) SieveIteratorremoved from the public API. (#79)- Removed
RandomPrimeWithRngtrait. (#79) - Removed
default-rngfeatures and corresponding API items. (#79) - Renamed
generate_(safe_)prime_with_rng()torandom_(safe_)prime(),fips_is_(safe_)prime_with_rng()tofips_is_(safe_)prime(). (#79) - Moved multicore functions to
multicoremodule and removedpar_prefixes. (#79) - Introduced
Flavorenum and removed_safesuffixes from functions. (#79) SieveFactorytrait moved tohazmatmodule. (#79)- The base chosen by
MillerRabin::test_random_base()can now be equal to 2. (#79) - Introudced
Errorenum;hazmatfunctions and method now return it instead of panicking. (#79) - Renamed
SmallPrimesSieveFactorytoSmallFactorsSieveFactory. (#79) - Moved
fips_is_prime()to its ownfipssubmodule and renamed tois_prime. (#79) - Bumped
crypto-bigintto 0.7.0-pre.1 and MSRV to 1.85. (#80) - Bumped
crypto-bigintto 0.7.0-pre.2. (#84) - Bumped
crypto-bigintto 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()andfips_is_safe_prime_with_rng(). (#72) - Add
estimate_primecount()– estimate the number of prime numbers smaller thanx. (#81)
-
0.7.0-pre.022 Feb 2025 pre-release -
0.6.207 Mar 2025 -
0.6.117 Feb 2025 withdrawn -
0.6.029 Jan 2025Release notes
Open source →Changed
- Renamed
SievetoSmallPrimesSieve. (#64) - Bumped
crypto-bigintto 0.6.0-rc.7 and MSRV to 1.83. (#67) - Bumped
crypto-bigintto 0.6. (#68) random_odd_integer()takes an additionalSetBitsargument. (#69)random_odd_integer()now returns aResultinstead of panicking. (#69)
Added
- Renamed
-
0.6.0-pre.219 Oct 2024 pre-release -
0.6.0-pre.104 Oct 2024 pre-releaseRelease notes
Open source →Changed
- Bumped
crypto-bigintto 0.6.0-rc.2 (and pinned, since there is a bug introduced in rc.3). (#48)
- Bumped
-
0.6.0-pre.029 Dec 2023 pre-releaseRelease notes
Open source →Changed
- Bumped
crypto-bigintto 0.6.0-pre.7. (#40) - Bumped MSRV to 1.73. (#36)
MillerRabin::new()takes anOdd-wrapped integer by value.random_odd_uint()returns anOdd-wrapped integer.LucasBase::generate()takes anOdd-wrapped integer.lucas_testtakes anOdd-wrapped integer. (#36)random_odd_uint()is renamed torandom_odd_integer(), takes aNonZeroU32forbit_length. (#38)- All bit length-type parameters take
u32instead ofusize. (#36) - All the API is based on the
Integertrait instead ofUintspecifically. (#38) - High-level generation/checking functions take an additional
bits_precisionargument. (#40)
- Bumped
-
0.5.021 Aug 2023 -
0.4.112 Jul 2023Release notes
Open source →Fixed
subtleversion requirement relaxed to the (implicit) 2.4, instead of technically requiring 2.5 to compile. (#30)
-
0.4.028 Jun 2023Release notes
Open source →Changed
- The crate is relicensed as Apache-2.0 or MIT, instead of AGPL-v3. (#29)
getrandomis not an explicit dependency anymore. This may break builds with thewasm32-unknown-unknowntarget which relied oncrypto-primesenabling thegetrandom/jsfeature. These builds are advised to do it themselves. (#28)
Fixed
Sieve::new()now panics whenmax_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)
-
0.3.005 May 2023Release notes
Open source →Changed
sieve_once()was removed (#22).MillerRabin::new()andtest_random_base()will panic if the input is invalid. (#22)MillerRabin::check()renamed totest(). (#22)- Prime-generating function take
Option<usize>instead ofusize, whereNonemeans the full size of theUint. (#19) - Renamed
prime()togenerate_prime(),safe_prime()togenerate_safe_prime(),prime_with_rng()togenerate_prime_with_rng(),safe_prime_with_rng()togenerate_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)
-
0.2.006 Mar 2023Release notes
Open source →Changed
- Bumped MSRV to 1.65 (
crypto-bigintrequirement). (#18) - Bumped
crypto-bigintto 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
RandomPrimeWithRngtrait for use in generic code. (#12)
Fixed
- Bumped MSRV to 1.65 (
-
0.1.021 Jan 2023