Skip to content

Commit

Permalink
Merge pull request #2490 from o1-labs/dw/implement-more-tests-for-mul…
Browse files Browse the repository at this point in the history
…-by-const

MVPoly: implement more tests for mul_by_const
  • Loading branch information
dannywillems authored Aug 27, 2024
2 parents 5d0b58a + 2b1559d commit 96897a1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions mvpoly/tests/prime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,19 @@ fn test_mul_by_const() {
p2[0] = c;
assert_eq!(p2 * p1.clone(), p1.clone().mul_by_const(c))
}

#[test]
fn test_mul_by_const_with_zero() {
let mut rng = o1_utils::tests::make_test_rng(None);
let p1 = Dense::<Fp, 4, 5>::random(&mut rng);
let c = Fp::zero();
assert_eq!(p1.mul_by_const(c), Dense::<Fp, 4, 5>::zero())
}

#[test]
fn test_mul_by_const_with_one() {
let mut rng = o1_utils::tests::make_test_rng(None);
let p1 = Dense::<Fp, 4, 5>::random(&mut rng);
let c = Fp::one();
assert_eq!(p1.mul_by_const(c), p1)
}

0 comments on commit 96897a1

Please sign in to comment.