use crate::{Limb, Uint}; use super::reduction::montgomery_reduction; pub(crate) const fn mul_montgomery_form( a: &Uint, b: &Uint, modulus: &Uint, mod_neg_inv: Limb, ) -> Uint { let product = a.mul_wide(b); montgomery_reduction::(&product, modulus, mod_neg_inv) } pub(crate) const fn square_montgomery_form( a: &Uint, modulus: &Uint, mod_neg_inv: Limb, ) -> Uint { let product = a.square_wide(); montgomery_reduction::(&product, modulus, mod_neg_inv) }