diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp index 1609f91d5ee..cb6ba2e7e97 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp @@ -149,14 +149,17 @@ std::shared_ptr ProtoGalaxyProver_prover_polynomials.get_all())) { - run_loop_in_parallel(acc_poly.size(), [&](size_t start_idx, size_t end_idx) { - for (size_t idx = start_idx; idx < end_idx; idx++) { - acc_poly[idx] += inst_poly[idx] * lagranges[inst_idx]; + auto accumulator_polys = acc_prover_polynomials.get_all(); + auto input_polys = instances[inst_idx]->prover_polynomials.get_all(); + run_loop_in_parallel(Flavor::NUM_ALL_ENTITIES, [&](size_t start_idx, size_t end_idx) { + for (size_t poly_idx = start_idx; poly_idx < end_idx; poly_idx++) { + auto& acc_poly = accumulator_polys[poly_idx]; + auto& inst_poly = input_polys[poly_idx]; + for (auto [acc_el, inst_el] : zip_view(acc_poly, inst_poly)) { + acc_el += inst_el * lagranges[inst_idx]; } - }); - } + } + }); } next_accumulator->prover_polynomials = std::move(acc_prover_polynomials);