Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hvy/integer-factorization
https://github.com/hvy/integer-factorization
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hvy/integer-factorization
- Owner: hvy
- Created: 2015-04-01T21:20:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-08-09T09:43:28.000Z (about 2 years ago)
- Last Synced: 2024-10-08T21:06:06.258Z (29 days ago)
- Language: C
- Size: 2.48 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Integer Factorization
An integer factorizer implmented in C using the GNU Multi-Precision Arithmetic Library (GMP, https://gmplib.org). The factorizer combines trial division, Pollard's Rho algorithm and the Quadratic Sieve for optimal results.
## How to Run
1. Install the GMP library from https://gmplib.org.
2. Run the Bash script *run.sh*.
3. Enter the number to factorize and press *Enter*.
4. Wait and hope for the best...## List of algorithms
- Trial Division - A set of smaller prime numbers are precomputed when the factorizer is started. If any of the primes divides the given number, we have found a prime factor.
- The Pollard's Rho Algorithm - The Pollard's Rho algorithm with Brent's cycle detection is used to quickly find smaller prime factors that were not found using the trial division.
- Quadratc Sieve - For larger integers that is not divided by any precomputed prime or that the Pollard's Rho algorithm can't handle, the Quadratic Sieve is used. This implementation of the Quadratic Sieve includes the Tonelli-Shanks algorithm to find square roots module primes and the Hensel's lifting lemma to speed up the factorization by generating the exponent vector for higher power larger than 1.