Skip to content

Commit ef9af7e

Browse files
committed
fix(bb): allocate gemini_masking_poly at dyadic virtual size
1 parent a4ac021 commit ef9af7e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,12 @@ template <typename Flavor> void OinkProver<Flavor>::commit_to_z_perm()
186186
template <typename Flavor> void OinkProver<Flavor>::commit_to_masking_poly()
187187
{
188188
if constexpr (flavor_has_gemini_masking<Flavor>()) {
189-
// Gemini masking poly only needs to cover the actual polynomial extent, not full dyadic size
189+
// Gemini masking poly only needs random content up to the actual polynomial extent, but its
190+
// virtual_size must match the rest of the sumcheck entities so the sumcheck main loop can
191+
// safely read the zero-padded virtual region past end_index.
190192
const size_t polynomial_size = prover_instance->polynomials.max_end_index();
191-
prover_instance->polynomials.gemini_masking_poly = Polynomial<FF>::random(polynomial_size);
193+
prover_instance->polynomials.gemini_masking_poly =
194+
Polynomial<FF>::random(polynomial_size, prover_instance->dyadic_size(), /*start_index=*/0);
192195

193196
// Commit to the masking polynomial and send to transcript
194197
auto masking_commitment = commitment_key.commit(prover_instance->polynomials.gemini_masking_poly);

0 commit comments

Comments
 (0)