recmo/uint

`modular`: Make mul_redc alloc-free

github-actions opened this issue · 0 comments

On 2023-07-29 @prestwich wrote in aaa37d2 “Merge pull request #277 from DaniPopes/no_alloc”:

Make mul_redc alloc-free

    ///
    /// # Panics
    ///
    /// Panics if `inv` is not correct.
    #[must_use]
    #[cfg(feature = "alloc")] // TODO: Make mul_redc alloc-free
    pub fn mul_redc(self, other: Self, modulus: Self, inv: u64) -> Self {
        if BITS == 0 {
            return Self::ZERO;
        }
        assert_eq!(inv.wrapping_mul(modulus.limbs[0]), u64::MAX);

From src/modular.rs:147