pub fn constrained_mod_inv<T>(a: T, modulus: &T) -> Option<T>where for<'a> T: Zero + One + Clone + PartialEq + PartialOrd + Sub<Output = T> + Add<&'a T, Output = T> + Sub<&'a T, Output = T>, for<'a> &'a T: Sub<T, Output = T> + Div<&'a T, Output = T>,
Version that works with references. Requires Clone and reference-based operations.