Skip to content

Commit

Permalink
Add non-reference scalar multiplication
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Mejías Gil <[email protected]>
  • Loading branch information
Cesar199999 and Antonio95 committed Jun 26, 2024
1 parent 8c4c4bc commit 399264e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions poly/src/polynomial/univariate/dense.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,15 @@ impl<'b, F: Field> Mul<F> for &'b DensePolynomial<F> {
}
}

impl<F: Field> Mul<F> for DensePolynomial<F> {
type Output = DensePolynomial<F>;

#[inline]
fn mul(self, elem: F) -> DensePolynomial<F> {
&self * elem
}
}

/// Performs O(nlogn) multiplication of polynomials if F is smooth.
impl<'a, 'b, F: FftField> Mul<&'a DensePolynomial<F>> for &'b DensePolynomial<F> {
type Output = DensePolynomial<F>;
Expand Down

0 comments on commit 399264e

Please sign in to comment.