         let _alpha_k = pow(alpha, U(UIntMax(half)), mod)
         for _ in 0..<half {
             let tpr = op.memory
-            let tphr = (_alpha * oph.memory) % mod
+            let tphr = mulmod(_alpha, oph.memory, mod)
             op.memory = addmod(tpr, tphr, mod)
-            oph.memory = addmod(tpr, (_alpha_k * tphr) % mod, mod)
-            _alpha = (_alpha * alpha) % mod
+            oph.memory = addmod(tpr, mulmod(_alpha_k, tphr, mod), mod)
+            _alpha = mulmod(_alpha, alpha, mod)
             op += out_stride
             oph += out_stride
         }

        let _alpha_k = modinv(pow(alpha, U(UIntMax(half)), mod), mod)
        for _ in 0..<half {
            let tpr = op.memory
            let tphr = (_alpha * oph.memory) % mod
            op.memory = addmod(tpr, tphr, mod)
            oph.memory = addmod(tpr, (_alpha_k * tphr) % mod, mod)
            _alpha = (_alpha * _inverse_alpha) % mod
            op += out_stride
            oph += out_stride
        }

        let _alpha_k = modinv(pow(alpha, U(UIntMax(half)), mod), mod)
        for _ in 0..<half {
            let tpr = op.memory
            let tphr = mulmod(_alpha, oph.memory, mod)
            op.memory = addmod(tpr, tphr, mod)
            oph.memory = addmod(tpr, mulmod(_alpha_k, tphr, mod), mod)
            _alpha = mulmod(_alpha, _inverse_alpha, mod)
            op += out_stride
            oph += out_stride
        }
