Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/uu/factor/src/numeric/montgomery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@ pub(crate) trait Arithmetic: Copy + Sized {

// Check that r (reduced back to the usual representation) equals
// a^b % n, unless the latter computation overflows
// Temporarily commented-out, as there u64::checked_pow is not available
// on the minimum supported Rust version, nor is an appropriate method
// for compiling the check conditionally.
//debug_assert!(self
// .to_u64(_a)
// .checked_pow(_b as u32)
// .map(|r| r % self.modulus() == self.to_u64(result))
// .unwrap_or(true));
debug_assert!(self
.to_u64(_a)
.checked_pow(_b as u32)
.map(|r| r % self.modulus() == self.to_u64(result))
.unwrap_or(true));

result
}
Expand Down