Skip to content

Commit

Permalink
add degree 5 and activate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zemse committed Jan 21, 2025
1 parent 90d4276 commit 8ae99b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions sumcheck/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ impl<'a, E: ExtensionField> IOPProverState<'a, E> {
2 => sumcheck_code_gen!(2, false, |i| &f[products[i]]).to_vec(),
3 => sumcheck_code_gen!(3, false, |i| &f[products[i]]).to_vec(),
4 => sumcheck_code_gen!(4, false, |i| &f[products[i]]).to_vec(),
_ => unimplemented!("do not support degree > 4"),
5 => sumcheck_code_gen!(5, false, |i| &f[products[i]]).to_vec(),
_ => unimplemented!("do not support degree {} > 5", products.len()),
};
exit_span!(span);
sum.iter_mut().for_each(|sum| *sum *= coefficient);
Expand Down Expand Up @@ -686,8 +687,8 @@ impl<'a, E: ExtensionField> IOPProverState<'a, E> {
2 => sumcheck_code_gen!(2, true, |i| &f[products[i]]).to_vec(),
3 => sumcheck_code_gen!(3, true, |i| &f[products[i]]).to_vec(),
4 => sumcheck_code_gen!(4, true, |i| &f[products[i]]).to_vec(),

_ => unimplemented!("do not support degree > 5"),
5 => sumcheck_code_gen!(5, true, |i| &f[products[i]]).to_vec(),
_ => unimplemented!("do not support degree {} > 5", products.len()),
};
exit_span!(span);
sum.iter_mut().for_each(|sum| *sum *= coefficient);
Expand Down
6 changes: 2 additions & 4 deletions sumcheck/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,27 @@ fn test_sumcheck_internal<E: ExtensionField>(
}

#[test]
#[ignore = "temporarily not supporting degree > 2"]
fn test_trivial_polynomial() {
test_trivial_polynomial_helper::<GoldilocksExt2>();
}

fn test_trivial_polynomial_helper<E: ExtensionField>() {
let nv = 1;
let num_multiplicands_range = (4, 13);
let num_multiplicands_range = (3, 5);
let num_products = 5;

test_sumcheck::<E>(nv, num_multiplicands_range, num_products);
test_sumcheck_internal::<E>(nv, num_multiplicands_range, num_products);
}

#[test]
#[ignore = "temporarily not supporting degree > 2"]
fn test_normal_polynomial() {
test_normal_polynomial_helper::<GoldilocksExt2>();
}

fn test_normal_polynomial_helper<E: ExtensionField>() {
let nv = 12;
let num_multiplicands_range = (4, 9);
let num_multiplicands_range = (3, 5);
let num_products = 5;

test_sumcheck::<E>(nv, num_multiplicands_range, num_products);
Expand Down

0 comments on commit 8ae99b4

Please sign in to comment.