25template <
typename Flavor>
57 typename Flavor::template ProverUnivariates<2>,
110 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
113 size_t max_end_index = 0;
114 if constexpr (
requires { multivariates.get_witness(); }) {
115 for (
auto& witness_poly : multivariates.get_witness()) {
116 max_end_index =
std::max(max_end_index, witness_poly.end_index());
122 size_t effective = max_end_index + (max_end_index % 2);
160 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
162 const ProverPolynomialsOrPartiallyEvaluatedMultivariates& multivariates,
163 const size_t edge_idx)
165 for (
auto [extended_edge, multivariate] :
zip_view(extended_edges.get_all(), multivariates.get_all())) {
169 if (multivariate.end_index() < edge_idx) {
171 extended_edge = zero_univariate;
174 .
template extend_to<MAX_PARTIAL_RELATION_LENGTH>();
184 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
215 ,
total_chunks(((end - start) / rpc) + ((end - start) % rpc > 0 ? 1 : 0))
217 BB_ASSERT(start % 2 == 0,
"start_edge_idx must be even");
218 BB_ASSERT(end % 2 == 0,
"end_edge_idx must be even");
219 BB_ASSERT(rpc >= 2 && rpc % 2 == 0,
"rows_per_chunk must be at least 2 and even");
220 BB_ASSERT(start <= end,
"start_edge_idx must not exceed end_edge_idx");
243 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
255 constexpr size_t rows_per_chunk = 16;
264 ExtendedEdges lazy_extended_edges(polynomials);
265 auto& accum = thread_univariate_accumulators[slot_id];
266 while (auto range = chunks.pop()) {
267 const auto [start, end] = *range;
268 for (size_t edge_idx = start; edge_idx < end; edge_idx += 2) {
269 lazy_extended_edges.set_current_edge(edge_idx);
275 accumulate_relation_univariates(
276 accum, lazy_extended_edges, relation_parameters, gate_separators[edge_idx]);
282 for (
auto& accumulators : thread_univariate_accumulators) {
302 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
303 static constexpr bool HAS_STATIC_ROW_SKIP_MANIFEST =
305 requires(
const ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials) {
316 if (!ranges.empty()) {
317 auto& previous = ranges.back();
318 const size_t previous_end = previous.starting_edge_idx + previous.size;
319 if (start <= previous_end) {
320 previous.size =
std::max(previous_end, end) - previous.starting_edge_idx;
329 if (blocks.empty()) {
333 return lhs.starting_edge_idx < rhs.starting_edge_idx;
336 size_t write_idx = 0;
337 for (
size_t read_idx = 1; read_idx < blocks.size(); ++read_idx) {
338 auto& previous = blocks[write_idx];
339 const auto& current = blocks[read_idx];
340 const size_t previous_end = previous.starting_edge_idx + previous.size;
341 if (current.starting_edge_idx <= previous_end) {
343 std::max(previous_end, current.starting_edge_idx + current.size) - previous.starting_edge_idx;
346 blocks[write_idx] = current;
349 blocks.resize(write_idx + 1);
352 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
354 ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
const size_t effective_round_size)
const
356 const size_t scan_start = excluded_head_size;
358 if (effective_round_size <= scan_start) {
362 if constexpr (HAS_STATIC_ROW_SKIP_MANIFEST<ProverPolynomialsOrPartiallyEvaluatedMultivariates>) {
364 if (row_skip_active_prefix_end == 0) {
365 append_scan_range(ranges, scan_start, effective_round_size);
369 const size_t active_prefix_end =
370 std::min(round_up_to_even(row_skip_active_prefix_end), effective_round_size);
371 append_scan_range(ranges, scan_start,
std::max(scan_start, active_prefix_end));
375 if (effective_round_size >= scan_start + 2) {
376 append_scan_range(ranges, effective_round_size - 2, effective_round_size);
379 append_scan_range(ranges, scan_start, effective_round_size);
397 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
399 ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials)
402 const size_t effective_round_size = compute_effective_round_size(polynomials);
405 const size_t start_edge_idx = excluded_head_size;
408 constexpr bool has_static_row_skip_manifest =
409 HAS_STATIC_ROW_SKIP_MANIFEST<ProverPolynomialsOrPartiallyEvaluatedMultivariates>;
412 if constexpr (has_static_row_skip_manifest) {
415 result = compute_row_skip_scan_ranges(polynomials, effective_round_size);
416 }
else if constexpr (can_skip_rows) {
419 compute_row_skip_scan_ranges(polynomials, effective_round_size);
425 for (
const auto& scan_range : scan_ranges) {
426 const size_t num_edge_pairs = scan_range.size / 2;
430 auto range = chunk.
range(num_edge_pairs);
437 size_t current_block_start = 0;
438 size_t current_block_size = 0;
440 for (
size_t pair_idx : range) {
441 size_t edge_idx = scan_range.starting_edge_idx + pair_idx * 2;
442 if (!Flavor::skip_entire_row(polynomials, edge_idx)) {
444 if (current_block_size == 0) {
445 current_block_start = edge_idx;
447 current_block_size += 2;
450 if (current_block_size > 0) {
453 current_block_size = 0;
458 if (current_block_size > 0) {
460 .size = current_block_size });
463 blocks.insert(blocks.end(), thread_blocks.begin(), thread_blocks.end());
468 for (
const auto& thread_blocks : all_thread_blocks) {
469 for (
const auto block : thread_blocks) {
470 result.push_back(block);
473 merge_contiguous_blocks(result);
476 .size = effective_round_size - start_edge_idx });
502 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
504 ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
511 constexpr bool has_static_row_skip_manifest =
512 HAS_STATIC_ROW_SKIP_MANIFEST<ProverPolynomialsOrPartiallyEvaluatedMultivariates>;
514 constexpr bool uses_row_manifest = has_static_row_skip_manifest || can_skip_rows;
516 if constexpr (!uses_row_manifest) {
520 const size_t effective_round_size = compute_effective_round_size(polynomials);
521 constexpr size_t rows_per_chunk = 64;
522 ChunkStealer chunks{ excluded_head_size, effective_round_size, rows_per_chunk };
531 ExtendedEdges extended_edges;
532 auto& accum = thread_univariate_accumulators[slot_id];
533 while (auto range = chunks.pop()) {
534 const auto [start, end] = *range;
535 for (size_t edge_idx = start; edge_idx < end; edge_idx += 2) {
536 extend_edges(extended_edges, polynomials, edge_idx);
543 FF scaling_factor{ 1 };
544 if constexpr (!isMultilinearBatchingFlavor<Flavor>) {
545 scaling_factor = gate_separators[edge_idx];
547 accumulate_relation_univariates(accum, extended_edges, relation_parameters, scaling_factor);
553 for (
auto& accumulators : thread_univariate_accumulators) {
554 Utils::add_nested_tuples(univariate_accumulators, accumulators);
558 return batch_over_relations<SumcheckRoundUnivariate>(univariate_accumulators, alphas, gate_separators);
565 BB_BENCH_NAME(
"compute_univariate_with_row_skipping/compute_manifest");
566 round_manifest = compute_contiguous_round_size(polynomials);
574 BB_BENCH_NAME(
"compute_univariate_with_row_skipping/accumulate_blocks");
576 ExtendedEdges extended_edges;
579 for (
const BlockOfContiguousRows& block : round_manifest) {
580 size_t block_iterations = block.size / 2;
583 auto iteration_range = chunk.range(block_iterations);
585 for (
size_t i : iteration_range) {
586 size_t edge_idx = block.starting_edge_idx + (i * 2);
587 extend_edges(extended_edges, polynomials, edge_idx);
597 FF scaling_factor{ 1 };
598 if constexpr (!isMultilinearBatchingFlavor<Flavor>) {
599 scaling_factor = gate_separators[edge_idx];
601 accumulate_relation_univariates(thread_univariate_accumulators[chunk.thread_index],
610 for (
auto& accumulators : thread_univariate_accumulators) {
611 Utils::add_nested_tuples(univariate_accumulators, accumulators);
615 return batch_over_relations<SumcheckRoundUnivariate>(univariate_accumulators, alphas, gate_separators);
627 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
629 ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
640 for (
size_t edge_idx = 0; edge_idx < excluded_head_size; edge_idx += 2) {
641 extend_edges(extended_edges, polynomials, edge_idx);
642 accumulate_relation_univariates(
643 univariate_accumulator, extended_edges, relation_parameters, gate_separators[edge_idx]);
646 result = batch_over_relations<SumcheckRoundUnivariate>(univariate_accumulator, alphas, gate_separators);
650 {
FF::one() - row_disabling_polynomial.eval_at_0,
FF::one() - row_disabling_polynomial.eval_at_1 });
652 one_minus_L.template extend_to<SumcheckRoundUnivariate::LENGTH>();
653 result *= one_minus_L_extended;
658 template <
typename ProverPolynomialsOrPartiallyEvaluatedMultivariates>
660 ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
672 const size_t virtual_contribution_edge_idx = 0;
676 auto extended_edges = [&]() {
679 lazy_extended_edges.set_current_edge(virtual_contribution_edge_idx);
680 return lazy_extended_edges;
683 extend_edges(extended_edges, polynomials, virtual_contribution_edge_idx);
684 return extended_edges;
689 const FF gate_separator_tail{ 1 };
690 accumulate_relation_univariates(
691 univariate_accumulator, extended_edges, relation_parameters, gate_separator_tail);
693 return batch_over_relations<SumcheckRoundUnivariate>(univariate_accumulator, alphas, gate_separator);
711 template <
typename ExtendedUnivariate,
typename ContainerOverSubrelations>
716 Utils::scale_univariates(univariate_accumulators, challenge);
718 auto result = ExtendedUnivariate(0);
719 extend_and_batch_univariates(univariate_accumulators, result, gate_separators);
722 Utils::zero_univariates(univariate_accumulators);
739 template <
typename ExtendedUnivariate,
typename TupleOfTuplesOfUnivariates>
741 ExtendedUnivariate& result,
746 ExtendedUnivariate extended_random_polynomial =
747 random_polynomial.template extend_to<ExtendedUnivariate::LENGTH>();
749 constexpr_for<0, std::tuple_size_v<TupleOfTuplesOfUnivariates>, 1>([&]<
size_t relation_idx>() {
752 [&]<
size_t subrelation_idx>() {
754 auto extended = element.template extend_to<ExtendedUnivariate::LENGTH>();
757 constexpr bool is_subrelation_linearly_independent =
758 bb::subrelation_is_linearly_independent<Relation, subrelation_idx>();
763 if constexpr (!is_subrelation_linearly_independent) {
794 for (
size_t idx = 0; idx < LIBRA_UNIVARIATES_LENGTH; ++idx) {
795 libra_round_univariate.
value_at(idx) =
798 if constexpr (BATCHED_RELATION_PARTIAL_LENGTH == LIBRA_UNIVARIATES_LENGTH) {
799 return libra_round_univariate;
801 return libra_round_univariate.template extend_to<SumcheckRoundUnivariate::LENGTH>();
807 const auto& extended_edges,
809 const FF& scaling_factor)
811 accumulate_relation_univariates(univariate_accumulators, extended_edges, relation_parameters, scaling_factor);
843 const auto& extended_edges,
845 const FF& scaling_factor)
847 constexpr_for<0, NUM_RELATIONS, 1>([&]<
size_t relation_idx>() {
858 if (!Relation::skip(extended_edges)) {
894 bool round_failed =
false;
899 FF target_total_sum = 0;
903 : target_total_sum(target_total_sum)
905 Utils::zero_elements(relation_evaluations);
916 const auto bound_tag = target_total_sum.get_origin_tag();
918 eval.set_origin_tag(bound_tag);
923 bool sumcheck_round_failed(
false);
925 sumcheck_round_failed = (target_total_sum.get_value() != total_sum.get_value());
926 target_total_sum.assert_equal(total_sum);
928 sumcheck_round_failed = (target_total_sum != total_sum);
930 round_failed = round_failed || sumcheck_round_failed;
938 target_total_sum = univariate.
evaluate(round_challenge);
949 Utils::template accumulate_relation_evaluations_without_skipping<>(purported_evaluations,
950 relation_evaluations,
953 return Utils::scale_and_batch_elements(relation_evaluations, alphas);
963 std::vector<FF>& multivariate_challenge,
968 std::string round_univariate_label =
"Sumcheck:univariate_" +
std::to_string(round_idx);
969 auto round_univariate =
970 transcript->template receive_from_prover<bb::Univariate<FF, BATCHED_RELATION_PARTIAL_LENGTH>>(
971 round_univariate_label);
972 FF round_challenge = transcript->template get_challenge<FF>(
"Sumcheck:u_" +
std::to_string(round_idx));
973 multivariate_challenge.emplace_back(round_challenge);
976 check_sum(round_univariate);
978 compute_next_target_sum(round_univariate, round_challenge);
988 bool verified =
false;
990 verified = (full_honk_purported_value.get_value() == target_total_sum.get_value());
991 full_honk_purported_value.assert_equal(target_total_sum);
993 verified = (full_honk_purported_value == target_total_sum);
1026 bool round_failed =
false;
1039 : target_total_sum(target_total_sum)
1041 Utils::zero_elements(relation_evaluations);
1052 Utils::template accumulate_relation_evaluations_without_skipping<>(purported_evaluations,
1053 relation_evaluations,
1054 relation_parameters,
1056 return Utils::scale_and_batch_elements(relation_evaluations, alphas);
1064 std::vector<FF>& multivariate_challenge,
1068 const std::string round_univariate_comm_label =
"Sumcheck:univariate_comm_" +
std::to_string(round_idx);
1069 const std::string univariate_eval_label_0 =
"Sumcheck:univariate_" +
std::to_string(round_idx) +
"_eval_0";
1070 const std::string univariate_eval_label_1 =
"Sumcheck:univariate_" +
std::to_string(round_idx) +
"_eval_1";
1073 round_univariate_commitments.push_back(
1074 transcript->template receive_from_prover<Commitment>(round_univariate_comm_label));
1076 round_univariate_evaluations.push_back(
1077 { transcript->template receive_from_prover<FF>(univariate_eval_label_0),
1078 transcript->template receive_from_prover<FF>(univariate_eval_label_1),
1081 const FF round_challenge = transcript->template get_challenge<FF>(
"Sumcheck:u_" +
std::to_string(round_idx));
1082 multivariate_challenge.emplace_back(round_challenge);
1097 FF first_sumcheck_round_evaluations_sum =
1098 round_univariate_evaluations[0][0] + round_univariate_evaluations[0][1];
1100 bool verified =
false;
1103 first_sumcheck_round_evaluations_sum.self_reduce();
1104 target_total_sum.self_reduce();
1105 full_honk_purported_value.self_reduce();
1107 verified = (first_sumcheck_round_evaluations_sum.get_value() == target_total_sum.get_value());
1108 first_sumcheck_round_evaluations_sum.assert_equal(target_total_sum);
1110 verified = (first_sumcheck_round_evaluations_sum == target_total_sum);
1115 for (
size_t round_idx = 1; round_idx < round_univariate_evaluations.size(); round_idx++) {
1116 round_univariate_evaluations[round_idx - 1][2] =
1117 round_univariate_evaluations[round_idx][0] + round_univariate_evaluations[round_idx][1];
1121 round_univariate_evaluations[round_univariate_evaluations.size() - 1][2] = full_honk_purported_value;
#define BB_ASSERT(expression,...)
bb::field< bb::Bn254FrParams > FF
#define BB_BENCH_NAME(name)
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
static constexpr bool HasZK
typename Curve::ScalarField FF
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
typename G1::affine_element Commitment
static size_t row_skip_active_prefix_end(const ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials)
static constexpr bool USE_SHORT_MONOMIALS
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t NUM_RELATIONS
BaseTranscript< Codec, HashFunction > Transcript
Relations_< FF > Relations
static constexpr size_t TRACE_OFFSET
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static void zero_univariates(auto &tuple)
Set all coefficients of Univariates to zero.
static constexpr void add_nested_tuples(Tuple &tuple_1, const Tuple &tuple_2)
Componentwise addition of nested tuples (tuples of tuples)
Imlementation of the Sumcheck prover round.
decltype(create_sumcheck_tuple_of_tuples_of_univariates< Relations >()) SumcheckTupleOfTuplesOfUnivariates
static constexpr size_t LIBRA_UNIVARIATES_LENGTH
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
The total algebraic degree of the Sumcheck relation as a polynomial in Prover Polynomials incremen...
std::conditional_t< Flavor::USE_SHORT_MONOMIALS, typename Flavor::template ProverUnivariates< 2 >, typename Flavor::ExtendedEdges > ExtendedEdges
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
The total algebraic degree of the Sumcheck relation as a polynomial in Prover Polynomials .
static void extend_and_batch_univariates(const TupleOfTuplesOfUnivariates &tuple, ExtendedUnivariate &result, const bb::GateSeparatorPolynomial< FF > &gate_separators)
Extend Univariates then sum them multiplying by the current -contributions.
static ExtendedUnivariate batch_over_relations(ContainerOverSubrelations &univariate_accumulators, const SubrelationSeparators &challenge, const bb::GateSeparatorPolynomial< FF > &gate_separators)
Given a tuple of tuples of extended per-relation contributions, and a challenge ,...
SumcheckRoundUnivariate compute_virtual_contribution(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const bb::RelationParameters< FF > &relation_parameters, const GateSeparatorPolynomial< FF > &gate_separator, const SubrelationSeparators &alphas)
size_t compute_effective_round_size(const ProverPolynomialsOrPartiallyEvaluatedMultivariates &multivariates) const
Compute the effective round size by finding the maximum end_index() across witness polynomials.
static void append_scan_range(std::vector< BlockOfContiguousRows > &ranges, const size_t start, const size_t end)
static void merge_contiguous_blocks(std::vector< BlockOfContiguousRows > &blocks)
std::vector< BlockOfContiguousRows > compute_row_skip_scan_ranges(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const size_t effective_round_size) const
SumcheckRoundUnivariate compute_univariate_with_row_skipping(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators alphas)
Return the evaluations of the univariate round polynomials at . Most likely, is around ....
SumcheckProverRound(size_t initial_round_size)
SumcheckRoundUnivariate compute_univariate_avm(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators &alphas)
A version of compute_univariate that is better optimized for the AVM.
SumcheckTupleOfTuplesOfUnivariates univariate_accumulators
SumcheckRoundUnivariate compute_univariate(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators &alphas)
Return the evaluations of the univariate round polynomials. Toggles between chunked computation (desi...
void extend_edges(ExtendedEdges &extended_edges, const ProverPolynomialsOrPartiallyEvaluatedMultivariates &multivariates, const size_t edge_idx)
To compute the round univariate in Round , the prover first computes the values of Honk polynomials ...
std::array< FF, Flavor::NUM_SUBRELATIONS - 1 > SubrelationSeparators
void accumulate_relation_univariates(SumcheckTupleOfTuplesOfUnivariates &univariate_accumulators, const auto &extended_edges, const bb::RelationParameters< FF > &relation_parameters, const FF &scaling_factor)
In Round , for a given point , calculate the contribution of each sub-relation to .
static SumcheckRoundUnivariate compute_libra_univariate(const ZKData &zk_sumcheck_data, size_t round_idx)
Compute Libra round univariate expressed given by the formula.
size_t excluded_head_size
static constexpr size_t NUM_RELATIONS
Number of batched sub-relations in specified by Flavor.
static size_t round_up_to_even(const size_t value)
SumcheckRoundUnivariate compute_disabled_contribution(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators &alphas, const RowDisablingPolynomial< FF > row_disabling_polynomial)
Compute the disabled rows' contribution to the round univariate.
std::vector< BlockOfContiguousRows > compute_contiguous_round_size(ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials)
Compute the number of unskippable rows we must iterate over.
typename Flavor::Relations Relations
size_t round_size
In Round , equals .
void accumulate_relation_univariates_public(SumcheckTupleOfTuplesOfUnivariates &univariate_accumulators, const auto &extended_edges, const bb::RelationParameters< FF > &relation_parameters, const FF &scaling_factor)
TupleOfArraysOfValues relation_evaluations
std::vector< std::array< FF, 3 > > round_univariate_evaluations
typename Flavor::Commitment Commitment
typename std::vector< FF > ClaimedLibraEvaluations
std::vector< Commitment > round_univariate_commitments
void process_round(const std::shared_ptr< Transcript > &transcript, std::vector< FF > &multivariate_challenge, bb::GateSeparatorPolynomial< FF > &gate_separators, size_t round_idx)
Process a single sumcheck round for Grumpkin: receive commitment and evaluations, defer per-round ver...
typename Flavor::Relations Relations
decltype(create_tuple_of_arrays_of_values< typename Flavor::Relations >()) TupleOfArraysOfValues
bool perform_final_verification(const FF &full_honk_purported_value)
Perform final verification for Grumpkin: check first round sum, populate Shplemini data,...
std::array< FF, Flavor::NUM_SUBRELATIONS - 1 > SubrelationSeparators
FF compute_full_relation_purported_value(const ClaimedEvaluations &purported_evaluations, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators &alphas)
Compute the full relation purported value.
std::vector< std::array< FF, 3 > > get_round_univariate_evaluations()
Get round univariate evaluations for Shplemini.
std::vector< Commitment > get_round_univariate_commitments()
Get round univariate commitments for Shplemini.
typename Flavor::Transcript Transcript
SumcheckVerifierRound(FF target_total_sum=0)
typename Flavor::AllValues ClaimedEvaluations
Implementation of the Sumcheck Verifier Round.
typename Flavor::Commitment Commitment
typename Flavor::Relations Relations
typename std::vector< FF > ClaimedLibraEvaluations
std::vector< std::array< FF, 3 > > get_round_univariate_evaluations()
Get round univariate evaluations (only used for Grumpkin flavors).
FF compute_full_relation_purported_value(const ClaimedEvaluations &purported_evaluations, const bb::RelationParameters< FF > &relation_parameters, const bb::GateSeparatorPolynomial< FF > &gate_separators, const SubrelationSeparators &alphas)
Compute the full relation purported value.
void check_sum(bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &univariate)
Check that the round target sum is correct.
void process_round(const std::shared_ptr< Transcript > &transcript, std::vector< FF > &multivariate_challenge, bb::GateSeparatorPolynomial< FF > &gate_separators, size_t round_idx)
Process a single sumcheck round: receive univariate from transcript, verify sum, generate challenge.
decltype(create_tuple_of_arrays_of_values< typename Flavor::Relations >()) TupleOfArraysOfValues
std::array< FF, Flavor::NUM_SUBRELATIONS - 1 > SubrelationSeparators
typename Flavor::AllValues ClaimedEvaluations
TupleOfArraysOfValues relation_evaluations
std::vector< Commitment > get_round_univariate_commitments()
Get round univariate commitments (only used for Grumpkin flavors).
bool perform_final_verification(const FF &full_honk_purported_value)
Perform final verification: check that the computed target sum matches the full relation evaluation....
typename Flavor::Transcript Transcript
void compute_next_target_sum(bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > &univariate, FF &round_challenge)
Compute the next target sum.
SumcheckVerifierRound(FF target_total_sum=0)
std::array< Fr, LENGTH > evaluations
Fr evaluate(const Fr &u) const
Evaluate a univariate at a point u not known at compile time and assumed not to be in the domain (els...
Check if the flavor has a static skip method to determine if accumulation of all relations can be ski...
The templates defined herein facilitate sharing the relation arithmetic between the prover and the ve...
Base class templates shared across Honk flavors.
constexpr size_t FF_COPY_COST
Entry point for Barretenberg command-line interface.
constexpr void constexpr_for(F &&f)
Implements a loop using a compile-time iterator. Requires c++20. Implementation (and description) fro...
void parallel_for_heuristic(size_t num_points, const std::function< void(size_t, size_t, size_t)> &func, size_t heuristic_cost)
Split a loop into several loops running in parallel based on operations in 1 iteration.
void parallel_for(size_t num_iterations, const std::function< void(size_t)> &func)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::string to_string(bb::avm2::ValueTag tag)
Implementation of the methods for the -polynomials used in in Sumcheck.
FF current_element() const
Computes the component at index current_element_idx in betas.
void partially_evaluate(FF challenge)
Partially evaluate the -polynomial at the new challenge and update .
FF partial_evaluation_result
The value obtained by partially evaluating one variable in the power polynomial at each round....
Container for parameters used by the grand product (permutation, lookup) Honk relations.
Polynomial for Sumcheck with disabled Rows.
Helper struct that describes a block of non-zero unskippable rows.
Shared chunk scheduler for dynamic work-stealing in the sumcheck prover's main loop.
const size_t rows_per_chunk
const size_t start_edge_idx
const size_t total_chunks
const size_t end_edge_idx
std::atomic< size_t > next_chunk
std::optional< std::pair< size_t, size_t > > pop()
ChunkStealer(size_t start, size_t end, size_t rpc)
auto range(size_t size, size_t offset=0) const
This structure is created to contain various polynomials and constants required by ZK Sumcheck.
std::vector< Polynomial< FF > > libra_univariates
static constexpr field one()