Generate a cunningham chain for 1st, 2nd, and bi-twin kinds.
Cunningham chains have many uses particularly in cryptography.
The program uses GMP to find big primes and test for primality.
Any chains found of sufficient size should be saved in findings.md. Contributions are welcome. Chains in findings.md are in the public domain–it is free for use by anyone for any purpose without restriction under copyright law.
- Install Rust and rustup (https://www.rust-lang.org/en-US/install.html)
- Checkout the program:
git clone https://github.com/mikelodder7/cunningham_chain.git
- Build the executable
cd ./cunningham_chain
cargo build --release
- Rust tests
cd ./cunningham_chain
cargo test
- Once the executable is built, the program can be run
cargo run bits=N length=L kind=K
or
./target/release/cunningham_chain bits=N length=L kind=K
All parameters are optional. Default values are bits=16, length=2, and kind=1 The following are allowed parameters
bits - A positive integer. The number of bits to use for generating the primes
length A positive integer. The minimum length of the Cunningham chain to find. The program will stop once it finds a chain equal to or longer than this value.
kind 1 or 2 or 3. 1 = 1st kind. 2 = 2nd kind. 3 = Bi-Twin