Skip to content

Commit

Permalink
Add pollards_rho to the factory
Browse files Browse the repository at this point in the history
  • Loading branch information
hesampakdaman committed Mar 31, 2024
1 parent 7e71ab0 commit 6c69f26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/algorithms.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod pollards_rho;
pub mod trial_division;

pub use self::pollards_rho::PollardsRho;
pub use self::trial_division::TrialDivision;
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fn main() {
.parse()
.expect("Please provide a valid positive integer");
match method.as_str() {
"pollards_rho" => println!("{}", Factorization::new(n, algorithms::PollardsRho)),
"trial_division" => println!("{}", Factorization::new(n, algorithms::TrialDivision)),
_ => eprintln!("Unknown algorithm. Available options: trial_division"),
_ => eprintln!("Unknown algorithm. Available options: pollards_rho, trial_division"),
}
}

0 comments on commit 6c69f26

Please sign in to comment.