#prime #numbers #generation #primality #miller-rabin

no-std crypto-primes

Random prime number generation and primality checking library

9 releases (5 breaking)

0.6.0-pre.2 Oct 19, 2024
0.6.0-pre.0 Dec 29, 2023
0.5.0 Aug 21, 2023
0.4.1 Jul 12, 2023
0.2.0 Mar 6, 2023

#148 in Cryptography

Download history 306/week @ 2024-07-24 433/week @ 2024-07-31 776/week @ 2024-08-07 526/week @ 2024-08-14 549/week @ 2024-08-21 367/week @ 2024-08-28 266/week @ 2024-09-04 569/week @ 2024-09-11 444/week @ 2024-09-18 742/week @ 2024-09-25 591/week @ 2024-10-02 225/week @ 2024-10-09 440/week @ 2024-10-16 477/week @ 2024-10-23 390/week @ 2024-10-30 292/week @ 2024-11-06

1,628 downloads per month
Used in 8 crates (2 directly)

Apache-2.0 OR MIT and maybe LGPL-3.0+

130KB
2K SLoC

Prime number tools for crypto-bigint

crate Docs License Build Status Coverage

This library implements prime number generation and primality checking for crypto-bigint integers. In particular:

  • Generating random primes and safe primes of given bit size;
  • Sieving iterator;
  • Miller-Rabin test;
  • Strong and extra strong Lucas tests, and Lucas-V test.

See the documentation for the specific tests for more information and references.

Dependencies

~0.9–6MB
~127K SLoC