diff --git a/mvpoly/src/prime.rs b/mvpoly/src/prime.rs index 1576e92e12..5ab133185e 100644 --- a/mvpoly/src/prime.rs +++ b/mvpoly/src/prime.rs @@ -302,7 +302,7 @@ impl Dense { Self::from_coeffs(coeffs) } - pub fn mul_by_const(&self, c: F) -> Self { + pub fn mul_by_scalar(&self, c: F) -> Self { let coeffs = self.coeff.iter().map(|coef| *coef * c).collect(); Self::from_coeffs(coeffs) } diff --git a/mvpoly/tests/prime.rs b/mvpoly/tests/prime.rs index 95348b696b..3a9fca76b7 100644 --- a/mvpoly/tests/prime.rs +++ b/mvpoly/tests/prime.rs @@ -239,33 +239,33 @@ fn test_neg_ref() { } #[test] -fn test_mul_by_const() { +fn test_mul_by_scalar() { let mut rng = o1_utils::tests::make_test_rng(None); let p1 = Dense::::random(&mut rng); let mut p2 = Dense::::zero(); let c = Fp::rand(&mut rng); p2[0] = c; - assert_eq!(p2 * p1.clone(), p1.clone().mul_by_const(c)) + assert_eq!(p2 * p1.clone(), p1.clone().mul_by_scalar(c)) } #[test] -fn test_mul_by_const_with_zero() { +fn test_mul_by_scalar_with_zero() { let mut rng = o1_utils::tests::make_test_rng(None); let p1 = Dense::::random(&mut rng); let c = Fp::zero(); - assert_eq!(p1.mul_by_const(c), Dense::::zero()) + assert_eq!(p1.mul_by_scalar(c), Dense::::zero()) } #[test] -fn test_mul_by_const_with_one() { +fn test_mul_by_scalar_with_one() { let mut rng = o1_utils::tests::make_test_rng(None); let p1 = Dense::::random(&mut rng); let c = Fp::one(); - assert_eq!(p1.mul_by_const(c), p1) + assert_eq!(p1.mul_by_scalar(c), p1) } #[test] -fn test_mul_by_const_with_from() { +fn test_mul_by_scalar_with_from() { let mut rng = o1_utils::tests::make_test_rng(None); let p = Dense::::random(&mut rng); let c = Fp::rand(&mut rng); @@ -273,8 +273,8 @@ fn test_mul_by_const_with_from() { // Create a constant polynomial from the field element let constant_poly = Dense::::from(c); - // Multiply p by c using mul_by_const - let result1 = p.mul_by_const(c); + // Multiply p by c using mul_by_scalar + let result1 = p.mul_by_scalar(c); // Multiply p by the constant polynomial let result2 = p.clone() * constant_poly;