{"id":15400265,"url":"https://github.com/indutny/bulk-gcd","last_synced_at":"2025-04-15T22:30:43.552Z","repository":{"id":62438643,"uuid":"161970961","full_name":"indutny/bulk-gcd","owner":"indutny","description":"Bulk GCD in Rust","archived":false,"fork":false,"pushed_at":"2019-01-01T17:24:21.000Z","size":55,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T22:54:14.099Z","etag":null,"topics":["bulk-gcd","fastgcd","gcd","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indutny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-16T05:30:08.000Z","updated_at":"2022-04-13T10:10:20.000Z","dependencies_parsed_at":"2022-11-01T22:01:37.551Z","dependency_job_id":null,"html_url":"https://github.com/indutny/bulk-gcd","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indutny%2Fbulk-gcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indutny%2Fbulk-gcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indutny%2Fbulk-gcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indutny%2Fbulk-gcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indutny","download_url":"https://codeload.github.com/indutny/bulk-gcd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249165874,"owners_count":21223341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulk-gcd","fastgcd","gcd","rust"],"created_at":"2024-10-01T15:53:20.794Z","updated_at":"2025-04-15T22:30:43.336Z","avatar_url":"https://github.com/indutny.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bulk-gcd\n[![Build Status](https://secure.travis-ci.org/indutny/bulk-gcd.svg)](http://travis-ci.org/indutny/bulk-gcd)\n[![Latest version](https://img.shields.io/crates/v/bulk-gcd.svg)](https://crates.io/crates/bulk-gcd)\n[![Documentation](https://docs.rs/bulk-gcd/badge.svg)](https://docs.rs/bulk-gcd)\n![License](https://img.shields.io/crates/l/bulk-gcd.svg)\n\nThis package provides and implementation of bulk GCD (Greatest Common Divisor)\nalgorithm by [D. Bernstein][bernstein].\n\n## Why?\n\nGCD is useful for identifying weak keys in a large set of RSA keys. Such\nsets were collected by researches (e.g. [this paper][that paper]). In order to\nfind weak keys a pairwise GCD has to be executed on all RSA moduli (i.e.\nproducts of two primes `P` and `Q`, pertaining to each RSA private key).\nHowever, each separate GCD computation takes considerable amount of time and the\nnaive pairwise process doesn't scale well (`O(n^2)`).\n\nInstead of doing this search in a brute-force way, this module employs clever\nalgorithm by [D. Bernstein][bernstein], that finds GCD of each moduli with a\nproduct of all other moduli. Through introduction of product and remainder\ntrees, the computational cost becomes logarithmic instead of quadratic, which\nresults in dramatic drop of the execution time.\n\n## Quick example\n\n```rust\nextern crate bulk_gcd;\nextern crate rug;\n\nuse rug::Integer;\n\nlet moduli = [\n    Integer::from(15),\n    Integer::from(35),\n    Integer::from(23),\n];\n\nlet result = bulk_gcd::compute(\u0026moduli).unwrap();\n\nassert_eq!(result, vec![\n    Some(Integer::from(5)),\n    Some(Integer::from(5)),\n    None,\n]);\n```\n\n## Using bulk-gcd\n\n`bulk-gcd` is available on [crates.io][crates]. To use `bulk-gcd` in your crate,\nadd it as a dependency inside [Cargo.toml][cargo doc]:\n\n```\n[dependencies]\nbulk-gcd = \"^1.0.0\"\n```\n\nYou also need to declare it by adding this to your crate root (usually\n`lib.rs` or `main.rs`):\n\n```rust\nextern crate bulk_gcd;\n```\n\n## Credits\n\nHuge thanks to [Michael Grunder][1] for helping me make threads work in Rust.\n\n[bernstein]: https://cr.yp.to/factorization/smoothparts-20040510.pdf\n[that paper]: https://factorable.net/weakkeys12.conference.pdf\n[crates]: https://crates.io/crates/bulk-gcd\n[cargo doc]: https://doc.rust-lang.org/cargo/guide/dependencies.html\n[1]: https://github.com/michael-grunder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findutny%2Fbulk-gcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findutny%2Fbulk-gcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findutny%2Fbulk-gcd/lists"}