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

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

#134 in Cryptography

Download history 480/week @ 2024-09-16 660/week @ 2024-09-23 786/week @ 2024-09-30 274/week @ 2024-10-07 379/week @ 2024-10-14 465/week @ 2024-10-21 339/week @ 2024-10-28 451/week @ 2024-11-04 307/week @ 2024-11-11 397/week @ 2024-11-18 535/week @ 2024-11-25 691/week @ 2024-12-02 639/week @ 2024-12-09 884/week @ 2024-12-16 165/week @ 2024-12-23 214/week @ 2024-12-30

1,969 downloads per month
Used in 15 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