Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_recursive_flavor.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
19
20namespace bb {
21
32
33 public:
34 // TODO(https://github.com/AztecProtocol/barretenberg/issues/990): Establish whether mini_circuit_size pattern is
35 // needed
38 using PCS = KZG<Curve>;
44 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
45
48
50
51 // Indicates that this flavor runs with non-ZK Sumcheck.
52 static constexpr bool HasZK = true;
53 // Translator proof size and its recursive verifier circuit are genuinely fixed, hence no padding is needed.
55 // None of this parameters can be changed
56
57 // Number of bits in a binary limb
58 // This is not a configurable value. Relations are sepcifically designed for it to be 68
59 static constexpr size_t NUM_LIMB_BITS = NativeFlavor::NUM_LIMB_BITS;
60
61 // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We
62 // often need containers of this size to hold related data, so we choose a name more agnostic than
63 // `NUM_POLYNOMIALS`. Note: this number does not include the individual sorted list polynomials.
65 // The number of polynomials precomputed to describe a circuit and to aid a prover in constructing a satisfying
66 // assignment of witnesses. We again choose a neutral name.
68 // The total number of witness entities not including shifts.
70
71 // Number of wires representing the op queue whose commitments are going to be checked against those from the
72 // final round of merge
74
76
78
79 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
80 static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>();
81
82 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
83 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
84 // length = 3
87
93 public:
95 using Base::Base;
96 };
105 class VerificationKey : public StdlibVerificationKey_<CircuitBuilder,
106 TranslatorFlavor::PrecomputedEntities<Commitment>,
107 VKSerializationMode::NO_METADATA> {
108 public:
110 {
111 // TODO(https://github.com/AztecProtocol/barretenberg/issues/1324): Remove `log_circuit_size` from MSGPACK
112 // and the verification key.
115 this->num_public_inputs = FF::from_witness(builder, native_key->num_public_inputs);
116 this->pub_inputs_offset = FF::from_witness(builder, native_key->pub_inputs_offset);
117
118 for (auto [native_comm, comm] : zip_view(native_key->get_all(), this->get_all())) {
119 comm = Commitment::from_witness(builder, native_comm);
120 }
121 }
122
129 FF hash_through_transcript([[maybe_unused]] const std::string& domain_separator,
130 [[maybe_unused]] Transcript& transcript) const override
131 {
132 throw_or_abort("Not intended to be used because vk is hardcoded in circuit.");
133 }
134
136 {
137 for (Commitment& commitment : this->get_all()) {
138 commitment.fix_witness();
139 }
140 }
141 };
142
147
149 // Reuse the VerifierCommitments from Translator
151 // Reuse the transcript from Translator
153
155};
156} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
Base Stdlib verification key class.
Definition flavor.hpp:303
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
A container for commitment labels.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
Container for all witness polynomials used/constructed by the prover.
static constexpr size_t NUM_ALL_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t CONST_TRANSLATOR_LOG_N
static constexpr size_t NUM_OP_QUEUE_WIRES
static constexpr bool USE_PADDING
static constexpr size_t NUM_LIMB_BITS
std::tuple< TranslatorPermutationRelation< FF >, TranslatorDeltaRangeConstraintRelation< FF >, TranslatorOpcodeConstraintRelation< FF >, TranslatorAccumulatorTransferRelation< FF >, TranslatorDecompositionRelation< FF >, TranslatorNonNativeFieldRelation< FF >, TranslatorZeroConstraintsRelation< FF > > Relations_
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
VerificationKey(CircuitBuilder *builder, const std::shared_ptr< NativeVerificationKey > &native_key)
FF hash_through_transcript(const std::string &domain_separator, Transcript &transcript) const override
Unused function because vk is hardcoded in recursive verifier, so no transcript hashing is needed.
The recursive counterpart of the native Translator flavor.
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
TranslatorFlavor::Relations_< FF > Relations
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t MAX_TOTAL_RELATION_LENGTH
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
static field_t from_witness(Builder *ctx, const bb::fr &input)
Definition field.hpp:432
void convert_constant_to_fixed_witness(Builder *ctx)
Definition field.hpp:422
AluTraceBuilder builder
Definition alu.test.cpp:123
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
Entry point for Barretenberg command-line interface.
BaseTranscript< stdlib::StdlibCodec< stdlib::field_t< UltraCircuitBuilder > >, stdlib::poseidon2< UltraCircuitBuilder > > UltraStdlibTranscript
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
field_t< CircuitBuilder > ScalarField
Definition bn254.hpp:33
Group::BaseField BaseField
Definition bn254.hpp:35
Group AffineElement
Definition bn254.hpp:37
void throw_or_abort(std::string const &err)