Self-initializing quadratic sieve (SIQS): factoring big integers (code review request)
⚓ Rust 📅 2025-10-05 👤 surdeus 👁️ 6I wrote a multithreaded Rust implementation of the self-initializing/multiple polynomial quadratic sieve (SIQS/MPQS) for factoring big integers using the rug big integer crate crates.io: Rust Package Registry. Here is my code: GitHub - TimoKellerMath/quadratic-sieve: Rust implementation of the self-initializing/multiple polynomial quadratic sieve (SIQS/MPQS)
On my 2.5 years old Laptop, it factors a 202 bit integer, a product of a 100 and a 102 bit prime, with 8 threads in less than 3 seconds.
I'm very interested in hearing your remarks about my coding style and improvements of the code, both in style and performance.
Please bear in mind that the code is written for myself. Hence I didn't write many comments, some variable names assume that you have an understanding of the algorithm, and some of the functions are quite long. Some parts of the code that can potentially improve performance under certain circumstances are commented out, so one can activate them if wanted. I didn't write many unit tests, instead I have many debug_asserts in the code.
1 post - 1 participant
🏷️ Rust_feed