58 static constexpr bool HasZK =
false;
66 template <
typename FF>
90 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
91 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
94 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
134 q_poseidon2_external,
135 q_poseidon2_external_initial,
136 q_poseidon2_quad_internal,
137 q_poseidon2_quad_internal_terminal,
138 q_poseidon2_transition_entry,
157 auto get_non_gate_selectors() {
return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4, q_5 }; };
168 q_poseidon2_external,
169 q_poseidon2_external_initial,
170 q_poseidon2_quad_internal,
171 q_poseidon2_quad_internal_terminal,
172 q_poseidon2_transition_entry,
205 kernel_calldata_read_counts,
206 kernel_calldata_inverses,
208 first_app_calldata_read_counts,
209 first_app_calldata_inverses,
211 second_app_calldata_read_counts,
212 second_app_calldata_inverses,
214 third_app_calldata_read_counts,
215 third_app_calldata_inverses,
217 return_data_read_counts,
218 return_data_inverses);
227 template <
typename DataType>
235 return RefArray{ this->ecc_op_wire_1, this->ecc_op_wire_2, this->ecc_op_wire_3, this->ecc_op_wire_4 };
242 if constexpr (bus_idx == 0) {
243 return RefArray{ this->kernel_calldata, this->kernel_calldata_read_counts };
244 }
else if constexpr (bus_idx == 1) {
245 return RefArray{ this->first_app_calldata, this->first_app_calldata_read_counts };
246 }
else if constexpr (bus_idx == 2) {
247 return RefArray{ this->second_app_calldata, this->second_app_calldata_read_counts };
248 }
else if constexpr (bus_idx == 3) {
249 return RefArray{ this->third_app_calldata, this->third_app_calldata_read_counts };
251 static_assert(bus_idx == 4);
252 return RefArray{ this->return_data, this->return_data_read_counts };
257 if constexpr (bus_idx == 0) {
258 return RefArray{ this->kernel_calldata_inverses };
259 }
else if constexpr (bus_idx == 1) {
260 return RefArray{ this->first_app_calldata_inverses };
261 }
else if constexpr (bus_idx == 2) {
262 return RefArray{ this->second_app_calldata_inverses };
263 }
else if constexpr (bus_idx == 3) {
264 return RefArray{ this->third_app_calldata_inverses };
266 static_assert(bus_idx == 4);
267 return RefArray{ this->return_data_inverses };
274 return concatenate(this->
template databus_entities_for_bus<Is>()...);
281 return concatenate(this->
template databus_inverse_for_bus<Is>()...);
315 template <
typename DataType>
414 lookup_inverses =
"LOOKUP_INVERSES";
415 lookup_read_counts =
"LOOKUP_READ_COUNTS";
416 lookup_read_tags =
"LOOKUP_READ_TAGS";
417 ecc_op_wire_1 =
"ECC_OP_WIRE_1";
418 ecc_op_wire_2 =
"ECC_OP_WIRE_2";
419 ecc_op_wire_3 =
"ECC_OP_WIRE_3";
420 ecc_op_wire_4 =
"ECC_OP_WIRE_4";
421 kernel_calldata =
"KERNEL_CALLDATA";
422 kernel_calldata_read_counts =
"KERNEL_CALLDATA_READ_COUNTS";
423 kernel_calldata_inverses =
"KERNEL_CALLDATA_INVERSES";
424 first_app_calldata =
"FIRST_APP_CALLDATA";
425 first_app_calldata_read_counts =
"FIRST_APP_CALLDATA_READ_COUNTS";
426 first_app_calldata_inverses =
"FIRST_APP_CALLDATA_INVERSES";
427 second_app_calldata =
"SECOND_APP_CALLDATA";
428 second_app_calldata_read_counts =
"SECOND_APP_CALLDATA_READ_COUNTS";
429 second_app_calldata_inverses =
"SECOND_APP_CALLDATA_INVERSES";
430 third_app_calldata =
"THIRD_APP_CALLDATA";
431 third_app_calldata_read_counts =
"THIRD_APP_CALLDATA_READ_COUNTS";
432 third_app_calldata_inverses =
"THIRD_APP_CALLDATA_INVERSES";
433 return_data =
"RETURN_DATA";
434 return_data_read_counts =
"RETURN_DATA_READ_COUNTS";
435 return_data_inverses =
"RETURN_DATA_INVERSES";
444 q_busread =
"Q_BUSREAD";
445 q_lookup =
"Q_LOOKUP";
447 q_delta_range =
"Q_SORT";
448 q_elliptic =
"Q_ELLIPTIC";
449 q_memory =
"Q_MEMORY";
451 q_poseidon2_external =
"Q_POSEIDON2_EXTERNAL";
452 q_poseidon2_external_initial =
"Q_POSEIDON2_EXTERNAL_INITIAL";
453 q_poseidon2_quad_internal =
"Q_POSEIDON2_QUAD_INTERNAL";
454 q_poseidon2_quad_internal_terminal =
"Q_POSEIDON2_QUAD_INTERNAL_TERMINAL";
455 q_poseidon2_transition_entry =
"Q_POSEIDON2_TRANSITION_ENTRY";
468 lagrange_first =
"LAGRANGE_FIRST";
469 lagrange_last =
"LAGRANGE_LAST";
470 lagrange_ecc_op =
"Q_ECC_OP_QUEUE";
477 template <
typename Commitment,
typename VerificationKey>
485 precomputed = precomputed_in;
489 if (witness_commitments.has_value()) {
490 for (
auto [witness, witness_in] :
492 witness = witness_in;
496 this->w_l_shift = witness_commitments->w_l;
497 this->w_r_shift = witness_commitments->w_r;
498 this->w_o_shift = witness_commitments->w_o;
499 this->w_4_shift = witness_commitments->w_4;
500 this->z_perm_shift = witness_commitments->z_perm;
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
A container for commitment labels.
DEFINE_FLAVOR_MEMBERS(DataType, z_perm, lookup_inverses, lookup_read_counts, lookup_read_tags, ecc_op_wire_1, ecc_op_wire_2, ecc_op_wire_3, ecc_op_wire_4, kernel_calldata, kernel_calldata_read_counts, kernel_calldata_inverses, first_app_calldata, first_app_calldata_read_counts, first_app_calldata_inverses, second_app_calldata, second_app_calldata_read_counts, second_app_calldata_inverses, third_app_calldata, third_app_calldata_read_counts, third_app_calldata_inverses, return_data, return_data_read_counts, return_data_inverses)
A base class labelling precomputed entities and (ordered) subsets of interest.
bool operator==(const PrecomputedEntities &) const =default
DEFINE_FLAVOR_MEMBERS(DataType, q_m, q_c, q_l, q_r, q_o, q_4, q_5, q_busread, q_lookup, q_arith, q_delta_range, q_elliptic, q_memory, q_nnf, q_poseidon2_external, q_poseidon2_external_initial, q_poseidon2_quad_internal, q_poseidon2_quad_internal_terminal, q_poseidon2_transition_entry, sigma_1, sigma_2, sigma_3, sigma_4, id_1, id_2, id_3, id_4, table_1, table_2, table_3, table_4, lagrange_first, lagrange_last, lagrange_ecc_op, databus_id) auto get_non_gate_selectors()
auto get_gate_selectors()
Class for ShiftedEntities, containing the shifted witness polynomials.
VerifierCommitments_(const std::shared_ptr< VerificationKey > &verification_key, const std::optional< WitnessEntities< Commitment > > &witness_commitments=std::nullopt)
DEFINE_FLAVOR_MEMBERS(DataType, w_l, w_r, w_o, w_4)
Container for all witness polynomials used/constructed by the prover.
auto databus_entities_for_bus()
auto get_databus_entities()
auto databus_inverse_for_bus()
auto get_databus_inverses()
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
ProverPolynomialsBase< AllEntities_< Polynomial >, AllValues, Polynomial > ProverPolynomials
A container for the prover polynomials handles.
crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams > HashFunction
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_WIRES
static constexpr size_t NUM_SUBRELATIONS
Curve::Element GroupElement
static constexpr size_t num_frs_fr
AllEntities_< FF > AllValues
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
static constexpr size_t NUM_RELATIONS
static constexpr size_t NUM_ALL_ENTITIES
std::tuple< bb::ArithmeticRelation< FF >, bb::UltraPermutationRelation< FF >, bb::LogDerivLookupRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EllipticRelation< FF >, bb::MemoryRelation< FF >, bb::NonNativeFieldRelation< FF >, bb::EccOpQueueRelation< FF >, bb::DatabusLookupRelation< FF >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InitialExternalRelation< FF >, bb::Poseidon2QuadInternalRelation< FF >, bb::Poseidon2QuadInternalTerminalRelation< FF >, bb::Poseidon2TransitionEntryRelation< FF > > Relations_
static constexpr bool HasZK
static constexpr size_t TRACE_OFFSET
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t VIRTUAL_LOG_N
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=VIRTUAL_LOG_N)
Relations_< FF > Relations
static constexpr bool USE_SHORT_MONOMIALS
Curve::AffineElement Commitment
static constexpr bool USE_PADDING
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t num_frs_comm
Base Native verification key class.
A container for storing the partially evaluated multivariates produced by sumcheck.
A container for polynomials handles used by the prover.
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static constexpr size_t NUM_WIRES
Wrapper holding a verification key and its precomputed hash.
typename Group::element Element
typename Group::affine_element AffineElement
Base class templates shared across Honk flavors.
#define DEFINE_FLAVOR_MEMBERS(DataType,...)
Define the body of a flavor class, included each member and a pointer view with which to iterate the ...
#define DEFINE_COMPOUND_GET_ALL(...)
Entry point for Barretenberg command-line interface.
RefArray< T,(Ns+...)> constexpr concatenate(const RefArray< T, Ns > &... ref_arrays)
Concatenates multiple RefArray objects into a single RefArray.
MegaCircuitBuilder_< field< Bn254FrParams > > MegaCircuitBuilder
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
The precomputed data needed to compute a Honk VK.