diff --git a/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp b/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp index 72f62b589fe..1a01f78481f 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp @@ -1,7 +1,6 @@ #pragma once -#include "barretenberg/commitment_schemes/commitment_key.hpp" +// #include "barretenberg/commitment_schemes/commitment_key.hpp" #include "barretenberg/commitment_schemes/ipa/ipa.hpp" -#include "barretenberg/commitment_schemes/kzg/kzg.hpp" #include "barretenberg/common/std_array.hpp" #include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" @@ -17,24 +16,16 @@ #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/relations/relation_types.hpp" #include "relation_definitions.hpp" -#include -#include -#include -#include -#include -#include - // NOLINTBEGIN(cppcoreguidelines-avoid-const-or-ref-data-members) namespace bb { -template class ECCVMBase { +class ECCVMFlavor { public: - // forward template params into the ECCVMBase namespace - using CycleGroup = CycleGroup_T; - using Curve = Curve_T; + using CycleGroup = bb::g1; + using Curve = curve::Grumpkin; using G1 = typename Curve::Group; - using PCS = PCS_T; + using PCS = IPA; using FF = typename G1::subgroup_field; using Polynomial = bb::Polynomial; @@ -300,7 +291,7 @@ template class ECCVMBa return concatenate(PrecomputedEntities::get_all(), WitnessEntities::get_all()); }; - auto get_to_be_shifted() { return ECCVMBase::get_to_be_shifted(*this); } + auto get_to_be_shifted() { return ECCVMFlavor::get_to_be_shifted(*this); } auto get_shifted() { return ShiftedEntities::get_all(); }; }; @@ -316,7 +307,7 @@ template class ECCVMBa using Base = ProvingKey_, WitnessEntities, CommitmentKey>; using Base::Base; - auto get_to_be_shifted() { return ECCVMBase::get_to_be_shifted(*this); } + auto get_to_be_shifted() { return ECCVMFlavor::get_to_be_shifted(*this); } // The plookup wires that store plookup read data. RefArray get_table_column_wires() { return {}; }; }; @@ -345,7 +336,6 @@ template class ECCVMBa public: using Base = AllEntities; using Base::Base; - AllValues(std::array _data_in) { this->_data = _data_in; } }; /** @@ -791,24 +781,17 @@ template class ECCVMBa } shplonk_q_comm = NativeTranscript::template deserialize_from_buffer( NativeTranscript::proof_data, num_frs_read); - if (std::is_same>::value) { - kzg_w_comm = NativeTranscript::template deserialize_from_buffer( - NativeTranscript::proof_data, num_frs_read); - } else if (std::is_same>::value) { - ipa_poly_degree = NativeTranscript::template deserialize_from_buffer( - NativeTranscript::proof_data, num_frs_read); - auto log_poly_degree = static_cast(numeric::get_msb(ipa_poly_degree)); - for (size_t i = 0; i < log_poly_degree; ++i) { - ipa_l_comms.emplace_back(NativeTranscript::template deserialize_from_buffer( - NativeTranscript::proof_data, num_frs_read)); - ipa_r_comms.emplace_back(NativeTranscript::template deserialize_from_buffer( - NativeTranscript::proof_data, num_frs_read)); - } - ipa_a_0_eval = - NativeTranscript::template deserialize_from_buffer(NativeTranscript::proof_data, num_frs_read); - } else { - throw_or_abort("Unsupported PCS"); + ipa_poly_degree = NativeTranscript::template deserialize_from_buffer(NativeTranscript::proof_data, + num_frs_read); + auto log_poly_degree = static_cast(numeric::get_msb(ipa_poly_degree)); + for (size_t i = 0; i < log_poly_degree; ++i) { + ipa_l_comms.emplace_back(NativeTranscript::template deserialize_from_buffer( + NativeTranscript::proof_data, num_frs_read)); + ipa_r_comms.emplace_back(NativeTranscript::template deserialize_from_buffer( + NativeTranscript::proof_data, num_frs_read)); } + ipa_a_0_eval = + NativeTranscript::template deserialize_from_buffer(NativeTranscript::proof_data, num_frs_read); } void serialize_full_transcript() @@ -911,25 +894,20 @@ template class ECCVMBa NativeTranscript::template serialize_to_buffer(gemini_a_evals[i], NativeTranscript::proof_data); } NativeTranscript::template serialize_to_buffer(shplonk_q_comm, NativeTranscript::proof_data); - if (std::is_same>::value) { - NativeTranscript::template serialize_to_buffer(kzg_w_comm, NativeTranscript::proof_data); - } else if (std::is_same>::value) { - NativeTranscript::template serialize_to_buffer(ipa_poly_degree, NativeTranscript::proof_data); - auto log_poly_degree = static_cast(numeric::get_msb(ipa_poly_degree)); - for (size_t i = 0; i < log_poly_degree; ++i) { - NativeTranscript::template serialize_to_buffer(ipa_l_comms[i], NativeTranscript::proof_data); - NativeTranscript::template serialize_to_buffer(ipa_r_comms[i], NativeTranscript::proof_data); - } - - NativeTranscript::template serialize_to_buffer(ipa_a_0_eval, NativeTranscript::proof_data); + NativeTranscript::template serialize_to_buffer(ipa_poly_degree, NativeTranscript::proof_data); + auto log_poly_degree = static_cast(numeric::get_msb(ipa_poly_degree)); + for (size_t i = 0; i < log_poly_degree; ++i) { + NativeTranscript::template serialize_to_buffer(ipa_l_comms[i], NativeTranscript::proof_data); + NativeTranscript::template serialize_to_buffer(ipa_r_comms[i], NativeTranscript::proof_data); } + + NativeTranscript::template serialize_to_buffer(ipa_a_0_eval, NativeTranscript::proof_data); + ASSERT(NativeTranscript::proof_data.size() == old_proof_length); } }; }; -class ECCVMFlavor : public ECCVMBase> {}; - // NOLINTEND(cppcoreguidelines-avoid-const-or-ref-data-members) } // namespace bb