53 static constexpr bool HasZK =
false;
84 template <
typename FF>
105 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
106 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
156 q_poseidon2_external,
157 q_poseidon2_internal,
176 auto get_non_gate_selectors() {
return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4 }; };
187 q_poseidon2_external,
188 q_poseidon2_internal,
224 calldata_read_counts,
228 secondary_calldata_read_counts,
229 secondary_calldata_read_tags,
230 secondary_calldata_inverses,
232 return_data_read_counts,
233 return_data_read_tags,
234 return_data_inverses);
247 static auto get_labels() {
return std::vector<std::string>{}; }
261 template <
typename DataType>
269 return RefArray{ this->ecc_op_wire_1, this->ecc_op_wire_2, this->ecc_op_wire_3, this->ecc_op_wire_4 };
274 this->
calldata, this->calldata_read_counts, this->calldata_read_tags,
275 this->secondary_calldata, this->secondary_calldata_read_counts, this->secondary_calldata_read_tags,
276 this->return_data, this->return_data_read_counts, this->return_data_read_tags
283 this->calldata_inverses,
284 this->secondary_calldata_inverses,
285 this->return_data_inverses,
298 this->lookup_inverses,
299 this->lookup_read_counts,
300 this->lookup_read_tags,
306 this->calldata_read_counts,
307 this->calldata_read_tags,
308 this->calldata_inverses,
309 this->secondary_calldata,
310 this->secondary_calldata_read_counts,
311 this->secondary_calldata_read_tags,
312 this->secondary_calldata_inverses,
314 this->return_data_read_counts,
315 this->return_data_read_tags,
316 this->return_data_inverses);
345 template <
typename DataType,
bool HasZK_ = HasZK>
401 for (
auto& poly : this->get_unshifted()) {
402 if (poly.is_empty()) {
404 poly =
Polynomial{ circuit_size, circuit_size };
418 for (
auto [result_field, polynomial] :
zip_view(result.
get_all(), this->get_all())) {
419 result_field = polynomial[row_idx];
427 for (
auto [result_field, polynomial] :
zip_view(result.
get_sigmas(), this->get_sigmas())) {
428 result_field = polynomial[row_idx];
430 for (
auto [result_field, polynomial] :
zip_view(result.
get_ids(), this->get_ids())) {
431 result_field = polynomial[row_idx];
433 for (
auto [result_field, polynomial] :
zip_view(result.
get_wires(), this->get_wires())) {
434 result_field = polynomial[row_idx];
442 shifted = to_be_shifted.shifted();
448 for (
auto& polynomial : this->
get_all()) {
449 polynomial.increase_virtual_size(size_in);
489 commitment = commitment_key.commit(polynomial);
512 for (
auto& poly : this->
get_all()) {
520 size_t desired_size = full_poly.end_index() / 2 + full_poly.end_index() % 2;
521 poly =
Polynomial(desired_size, circuit_size / 2);
559 lookup_inverses =
"LOOKUP_INVERSES";
560 lookup_read_counts =
"LOOKUP_READ_COUNTS";
561 lookup_read_tags =
"LOOKUP_READ_TAGS";
562 ecc_op_wire_1 =
"ECC_OP_WIRE_1";
563 ecc_op_wire_2 =
"ECC_OP_WIRE_2";
564 ecc_op_wire_3 =
"ECC_OP_WIRE_3";
565 ecc_op_wire_4 =
"ECC_OP_WIRE_4";
567 calldata_read_counts =
"CALLDATA_READ_COUNTS";
568 calldata_read_tags =
"CALLDATA_READ_TAGS";
569 calldata_inverses =
"CALLDATA_INVERSES";
570 secondary_calldata =
"SECONDARY_CALLDATA";
571 secondary_calldata_read_counts =
"SECONDARY_CALLDATA_READ_COUNTS";
572 secondary_calldata_read_tags =
"SECONDARY_CALLDATA_READ_TAGS";
573 secondary_calldata_inverses =
"SECONDARY_CALLDATA_INVERSES";
574 return_data =
"RETURN_DATA";
575 return_data_read_counts =
"RETURN_DATA_READ_COUNTS";
576 return_data_read_tags =
"RETURN_DATA_READ_TAGS";
577 return_data_inverses =
"RETURN_DATA_INVERSES";
585 q_busread =
"Q_BUSREAD";
586 q_lookup =
"Q_LOOKUP";
588 q_delta_range =
"Q_SORT";
589 q_elliptic =
"Q_ELLIPTIC";
590 q_memory =
"Q_MEMORY";
592 q_poseidon2_external =
"Q_POSEIDON2_EXTERNAL";
593 q_poseidon2_internal =
"Q_POSEIDON2_INTERNAL";
606 lagrange_first =
"LAGRANGE_FIRST";
607 lagrange_last =
"LAGRANGE_LAST";
608 lagrange_ecc_op =
"Q_ECC_OP_QUEUE";
615 template <
typename Commitment,
typename VerificationKey,
bool HasZK_ = HasZK>
623 precomputed = precomputed_in;
627 if (witness_commitments.has_value()) {
628 for (
auto [witness, witness_in] :
630 witness = witness_in;
634 this->w_l_shift = witness_commitments->w_l;
635 this->w_r_shift = witness_commitments->w_r;
636 this->w_o_shift = witness_commitments->w_o;
637 this->w_4_shift = witness_commitments->w_4;
638 this->z_perm_shift = witness_commitments->z_perm;
#define BB_BENCH_NAME(name)
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...
DEFINE_COMPOUND_GET_ALL(MaskingEntities< DataType, HasZK_ >, PrecomputedEntities< DataType >, WitnessEntities_< DataType >, ShiftedEntities< DataType >) auto get_unshifted()
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
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, calldata, calldata_read_counts, calldata_read_tags, calldata_inverses, secondary_calldata, secondary_calldata_read_counts, secondary_calldata_read_tags, secondary_calldata_inverses, return_data, return_data_read_counts, return_data_read_tags, return_data_inverses)
ZK-specific entities (only used when HasZK = true)
A container for storing the partially evaluated multivariates produced by sumcheck.
PartiallyEvaluatedMultivariates_(const size_t circuit_size)
PartiallyEvaluatedMultivariates_(const ProverPolynomials_< HasZK_ > &full_polynomials, size_t circuit_size)
PartiallyEvaluatedMultivariates_()=default
A base class labelling precomputed entities and (ordered) subsets of interest.
DEFINE_FLAVOR_MEMBERS(DataType, q_m, q_c, q_l, q_r, q_o, q_4, q_busread, q_lookup, q_arith, q_delta_range, q_elliptic, q_memory, q_nnf, q_poseidon2_external, q_poseidon2_internal, 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()
bool operator==(const PrecomputedEntities &) const =default
auto get_gate_selectors()
A container for the prover polynomials handles.
void increase_polynomials_virtual_size(const size_t size_in)
size_t get_polynomial_size() const
ProverPolynomials_()=default
ProverPolynomials_ & operator=(ProverPolynomials_ &&o) noexcept=default
ProverPolynomials_(size_t circuit_size)
ProverPolynomials_(const ProverPolynomials_ &o)=delete
ProverPolynomials_ & operator=(const ProverPolynomials_ &)=delete
AllValues_< HasZK_ > get_row_for_permutation_arg(size_t row_idx)
AllValues_< HasZK_ > get_row(size_t row_idx) const
~ProverPolynomials_()=default
ProverPolynomials_(ProverPolynomials_ &&o) noexcept=default
Class for ShiftedEntities, containing the shifted witness polynomials.
The verification key is responsible for storing the commitments to the precomputed (non-witness) poly...
VerificationKey(const PrecomputedData &precomputed)
VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
bool compare(const VerificationKey &other)
VerificationKey()=default
void set_metadata(const MetaData &metadata)
VerificationKey(const VerificationKey &vk)=default
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 get_databus_entities()
auto get_databus_inverses()
MSGPACK_FIELDS(this->w_l, this->w_r, this->w_o, this->w_4, this->z_perm, this->lookup_inverses, this->lookup_read_counts, this->lookup_read_tags, this->ecc_op_wire_1, this->ecc_op_wire_2, this->ecc_op_wire_3, this->ecc_op_wire_4, this->calldata, this->calldata_read_counts, this->calldata_read_tags, this->calldata_inverses, this->secondary_calldata, this->secondary_calldata_read_counts, this->secondary_calldata_read_tags, this->secondary_calldata_inverses, this->return_data, this->return_data_read_counts, this->return_data_read_tags, this->return_data_inverses)
static constexpr size_t NUM_PRECOMPUTED_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::Poseidon2InternalRelation< FF > > Relations_
static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_WIRES
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t NUM_SUBRELATIONS
Curve::Element GroupElement
static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS
static constexpr size_t num_frs_fr
static constexpr size_t NUM_RELATIONS
static constexpr size_t NUM_ALL_ENTITIES
static constexpr bool HasZK
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)
bb::Polynomial< FF > Polynomial
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 bool has_zero_row
static constexpr size_t num_frs_comm
Base Native verification key class.
uint64_t num_public_inputs
uint64_t log_circuit_size
uint64_t pub_inputs_offset
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
typename Group::element Element
typename Group::affine_element AffineElement
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
#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(...)
constexpr T get_msb(const T in)
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.
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
MegaCircuitBuilder_< field< Bn254FrParams > > MegaCircuitBuilder
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::vector< MemoryValue > calldata
The precomputed data needed to compute a Honk VK.
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials