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

no-std crypto-primes

Random prime number generation and primality checking library

7 releases (breaking)

0.6.0-pre.0 Dec 29, 2023
0.5.0 Aug 21, 2023
0.4.1 Jul 12, 2023
0.4.0 Jun 28, 2023
0.1.0 Jan 21, 2023

#252 in Cryptography

Download history 193/week @ 2024-03-13 265/week @ 2024-03-20 359/week @ 2024-03-27 396/week @ 2024-04-03 454/week @ 2024-04-10 210/week @ 2024-04-17 299/week @ 2024-04-24 284/week @ 2024-05-01 227/week @ 2024-05-08 270/week @ 2024-05-15 185/week @ 2024-05-22 381/week @ 2024-05-29 253/week @ 2024-06-05 180/week @ 2024-06-12 433/week @ 2024-06-19 223/week @ 2024-06-26

1,119 downloads per month
Used in 9 crates (2 directly)

Apache-2.0 OR MIT and maybe LGPL-3.0+

125KB
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.8–5.5MB
~121K SLoC