Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/modular/bernstein_yang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize>
///
/// This is defined on this type to piggyback on the definitions for `SAT_LIMBS` and `UNSAT_LIMBS` which are
/// computed when defining `PrecomputeInverter::Inverter` for various `Uint` limb sizes.
pub(crate) fn gcd(f: &Uint<SAT_LIMBS>, g: &Uint<SAT_LIMBS>) -> Uint<SAT_LIMBS> {
pub(crate) const fn gcd(f: &Uint<SAT_LIMBS>, g: &Uint<SAT_LIMBS>) -> Uint<SAT_LIMBS> {
let f_0 = Int62L::from_uint(f);
let inverse = inv_mod2_62(f.as_words());

Expand Down
4 changes: 2 additions & 2 deletions src/uint/gcd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ where
/// Compute the greatest common divisor (GCD) of this number and another.
///
/// Panics if `self` is odd.
pub fn gcd(&self, rhs: &Self) -> Self {
debug_assert!(bool::from(self.is_odd()));
pub const fn gcd(&self, rhs: &Self) -> Self {
debug_assert!(self.is_odd().is_true_vartime());
<Self as PrecomputeInverter>::Inverter::gcd(self, rhs)
}
}
Expand Down