From 399264ef54dea8893365dd7738ebd96d251756c5 Mon Sep 17 00:00:00 2001 From: Cesar199999 Date: Wed, 26 Jun 2024 09:33:01 +0200 Subject: [PATCH] Add non-reference scalar multiplication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Antonio Mejías Gil --- poly/src/polynomial/univariate/dense.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/poly/src/polynomial/univariate/dense.rs b/poly/src/polynomial/univariate/dense.rs index f9cec676f..3dfd3dfeb 100644 --- a/poly/src/polynomial/univariate/dense.rs +++ b/poly/src/polynomial/univariate/dense.rs @@ -619,6 +619,15 @@ impl<'b, F: Field> Mul for &'b DensePolynomial { } } +impl Mul for DensePolynomial { + type Output = DensePolynomial; + + #[inline] + fn mul(self, elem: F) -> DensePolynomial { + &self * elem + } +} + /// Performs O(nlogn) multiplication of polynomials if F is smooth. impl<'a, 'b, F: FftField> Mul<&'a DensePolynomial> for &'b DensePolynomial { type Output = DensePolynomial;