diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp index d127c31979d5..919c20b3d3be 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp @@ -1,6 +1,8 @@ #pragma once #include "barretenberg/common/zip_view.hpp" #include "barretenberg/polynomials/polynomial.hpp" +#include "barretenberg/transcript/transcript.hpp" + namespace proof_system::honk::pcs::zeromorph { /** @@ -404,9 +406,7 @@ template class ZeroMorphProver_ { transcript.send_to_verifier("ZM:C_q", q_commitment); // Get challenges x and z - auto challenges = transcript.get_challenges("ZM:x", "ZM:z"); - FF x_challenge = challenges[0]; - FF z_challenge = challenges[1]; + auto [x_challenge, z_challenge] = challenges_to_field_elements(transcript.get_challenges("ZM:x", "ZM:z")); // Compute degree check polynomial \zeta partially evaluated at x auto zeta_x = @@ -675,9 +675,7 @@ template class ZeroMorphVerifier_ { auto C_q = transcript.template receive_from_prover("ZM:C_q"); // Challenges x, z - auto challenges = transcript.get_challenges("ZM:x", "ZM:z"); - FF x_challenge = challenges[0]; - FF z_challenge = challenges[1]; + auto [x_challenge, z_challenge] = challenges_to_field_elements(transcript.get_challenges("ZM:x", "ZM:z")); // Compute commitment C_{\zeta_x} auto C_zeta_x = compute_C_zeta_x(C_q, C_q_k, y_challenge, x_challenge); diff --git a/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp index 7dc1568130f5..4b32e4295c31 100644 --- a/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp +++ b/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp @@ -339,7 +339,7 @@ class BaseTranscript { * @details The syntax `std::array [a, b] = transcript.get_challenges("a", "b")` is unfortunately not allowed * (structured bindings must be defined with auto return type), so we need a workaround. */ -template std::array challenges_to_field_elements(std::array&& arr) +template std::array challenges_to_field_elements(std::array&& arr) { std::array result; std::move(arr.begin(), arr.end(), result.begin());