#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

#148 in Cryptography

Download history 551/week @ 2024-08-17 474/week @ 2024-08-24 206/week @ 2024-08-31 400/week @ 2024-09-07 523/week @ 2024-09-14 657/week @ 2024-09-21 763/week @ 2024-09-28 308/week @ 2024-10-05 269/week @ 2024-10-12 567/week @ 2024-10-19 341/week @ 2024-10-26 444/week @ 2024-11-02 277/week @ 2024-11-09 396/week @ 2024-11-16 483/week @ 2024-11-23 705/week @ 2024-11-30

1,949 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