diff --git a/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs b/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs index ef945ae41..2213aa3d9 100644 --- a/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs +++ b/crates/proof-of-sql/src/sql/proof_plans/group_by_exec.rs @@ -361,13 +361,13 @@ fn verify_group_by( g_in_star_eval * sel_in_eval * sum_in_fold_eval - g_out_star_eval * sum_out_bar_fold_eval, ); - // g_in_star * g_in_fold - 1 = 0 + // g_in_star * g_in_fold - input_ones = 0 builder.produce_sumcheck_subpolynomial_evaluation( &SumcheckSubpolynomialType::Identity, g_in_star_eval * g_in_fold_eval - one_eval, ); - // g_out_star * g_out_bar_fold - 1 = 0 + // g_out_star * g_out_bar_fold - input_ones = 0 builder.produce_sumcheck_subpolynomial_evaluation( &SumcheckSubpolynomialType::Identity, g_out_star_eval * g_out_bar_fold_eval - one_eval, @@ -390,6 +390,7 @@ pub fn prove_group_by<'a, S: Scalar>( n: usize, ) { let m_out = count_out.len(); + let input_ones = alloc.alloc_slice_fill_copy(n, true); // g_in_fold = alpha + sum beta^j * g_in[j] let g_in_fold = alloc.alloc_slice_fill_copy(n, alpha); @@ -442,7 +443,7 @@ pub fn prove_group_by<'a, S: Scalar>( ], ); - // g_in_star * g_in_fold - 1 = 0 + // g_in_star * g_in_fold - input_ones = 0 builder.produce_sumcheck_subpolynomial( SumcheckSubpolynomialType::Identity, vec![ @@ -450,11 +451,11 @@ pub fn prove_group_by<'a, S: Scalar>( S::one(), vec![Box::new(g_in_star as &[_]), Box::new(g_in_fold as &[_])], ), - (-S::one(), vec![]), + (-S::one(), vec![Box::new(input_ones as &[_])]), ], ); - // g_out_star * g_out_bar_fold - 1 = 0 + // g_out_star * g_out_bar_fold - input_ones = 0 builder.produce_sumcheck_subpolynomial( SumcheckSubpolynomialType::Identity, vec![ @@ -465,7 +466,7 @@ pub fn prove_group_by<'a, S: Scalar>( Box::new(g_out_bar_fold as &[_]), ], ), - (-S::one(), vec![]), + (-S::one(), vec![Box::new(input_ones as &[_])]), ], ); }