48 using Point = Flavor::Curve::AffineElement;
150 :
std::runtime_error(
std::string(
"Chonk Proof deserialization error: ") + msg)
185 std::vector<bb::fr> elements;
187 auto mega_elements =
mega->to_field_elements();
188 elements.insert(elements.end(), mega_elements.begin(), mega_elements.end());
190 auto eccvm_elements =
eccvm->to_field_elements();
191 elements.insert(elements.end(), eccvm_elements.begin(), eccvm_elements.end());
193 auto translator_elements =
translator->to_field_elements();
194 elements.insert(elements.end(), translator_elements.begin(), translator_elements.end());
209 size_t mega_read =
mega->from_field_elements(elements.subspan(read_idx));
210 read_idx += mega_read;
213 size_t eccvm_read =
eccvm->from_field_elements(elements.subspan(read_idx));
214 read_idx += eccvm_read;
217 size_t translator_read =
translator->from_field_elements(elements.subspan(read_idx));
218 read_idx += translator_read;
293 const std::vector<std::shared_ptr<RecursiveVKAndHash>>& input_keys = {});
295 [[nodiscard(
"Pairing points should be accumulated")]]
std::
299 const StdlibVerifierInputs& verifier_inputs,
336 const std::shared_ptr<Transcript>& verifier_transcript);
354 size_t num_frs = Chonk::VerificationKey::calc_num_data_types();
357 std::vector<bb::fr> field_elements(num_frs);
358 for (
auto& element : field_elements) {
363 vk.from_field_elements(field_elements);
371 auto field_elements =
vk.to_field_elements();
372 for (
const auto& element : field_elements) {
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
DeserializationError(const std::string &msg)
The IVC scheme used by the aztec client for private function execution.
ProverAccumulator prover_accumulator
Goblin & get_goblin() override
void instantiate_stdlib_verification_queue(ClientCircuit &circuit, const std::vector< std::shared_ptr< RecursiveVKAndHash > > &input_keys={})
Instantiate a stdlib verification queue for use in the kernel completion logic.
HonkProof construct_honk_proof_for_hiding_kernel(ClientCircuit &circuit, const std::shared_ptr< MegaVerificationKey > &verification_key)
Construct a zero-knowledge proof for the Hiding kernel, which recursively verifies the last folding,...
void complete_kernel_circuit_logic(ClientCircuit &circuit)
Append logic to complete a kernel circuit.
std::tuple< std::optional< RecursiveVerifierAccumulator >, std::vector< PairingPoints >, TableCommitments > perform_recursive_verification_and_databus_consistency_checks(ClientCircuit &circuit, const StdlibVerifierInputs &verifier_inputs, const std::optional< RecursiveVerifierAccumulator > &input_verifier_accumulator, const TableCommitments &T_prev_commitments, const std::shared_ptr< RecursiveTranscript > &accumulation_recursive_transcript)
Populate the provided circuit with constraints for (1) recursive verification of the provided accumul...
VerifierAccumulator native_verifier_accum
void update_native_verifier_accumulator(const VerifierInputs &queue_entry, const std::shared_ptr< Transcript > &verifier_transcript)
Update native verifier accumulator. Useful for debugging.
Proof prove()
Construct a proof for the IVC, which, if verified, fully establishes its correctness.
static void hide_op_queue_content_in_hiding(ClientCircuit &circuit)
Adds two random non-ops to the hiding kernel for zero-knowledge.
std::array< RecursiveFlavor::Commitment, ClientCircuit::NUM_WIRES > TableCommitments
std::shared_ptr< Transcript > transcript
size_t num_circuits_accumulated
Flavor::Commitment Commitment
void debug_incoming_circuit(ClientCircuit &circuit, const std::shared_ptr< ProverInstance > &prover_instance, const std::shared_ptr< MegaVerificationKey > &precomputed_vk)
Flavor::Curve::AffineElement Point
FF native_verifier_accum_hash
size_t get_num_circuits() const
QUEUE_TYPE get_queue_type() const
Get queue type for the proof of a circuit about to be accumulated based on num circuits accumulated s...
std::deque< StdlibVerifierInputs > StdlibVerificationQueue
static void hide_op_queue_content_in_tail(ClientCircuit &circuit)
Adds three random non-ops to the tail kernel for zero-knowledge.
RecursiveFlavor::FF StdlibFF
VerifierAccumulator recursive_verifier_native_accum
static void hide_op_queue_accumulation_result(ClientCircuit &circuit)
Add a hiding op with fully random Px, Py field elements to prevent information leakage in Translator ...
RecursiveFlavor::Commitment RecursiveCommitment
MegaFlavor::CommitmentKey bn254_commitment_key
void accumulate(ClientCircuit &circuit, const std::shared_ptr< MegaVerificationKey > &precomputed_vk) override
Perform prover work for accumulation (e.g. HN folding, merge proving)
MegaCircuitBuilder ClientCircuit
VerificationKey get_vk() const
const Goblin & get_goblin() const override
std::deque< VerifierInputs > VerificationQueue
VerificationQueue verification_queue
std::shared_ptr< Transcript > prover_accumulation_transcript
static bool verify(const Proof &proof, const VerificationKey &vk)
StdlibVerificationQueue stdlib_verification_queue
CommitmentKey object over a pairing group 𝔾₁.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS
static constexpr size_t PUBLIC_INPUTS_SIZE
MultilinearBatchingProverClaim Accumulator
MultilinearBatchingVerifierClaim< Curve > Accumulator
Base class interface for IVC schemes.
A container for the prover polynomials handles.
The verification key is responsible for storing the commitments to the precomputed (non-witness) poly...
Container for all witness polynomials used/constructed by the prover.
ProverPolynomials_< HasZK > ProverPolynomials
Curve::AffineElement Commitment
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
The recursive counterpart to the "native" Mega flavor.
StdlibTranscript< CircuitBuilder > Transcript
typename Curve::Element Commitment
typename Curve::ScalarField FF
VKAndHash_< FF, VerificationKey > VKAndHash
MegaFlavor::WitnessEntities< Commitment > WitnessCommitments
A container for the witness commitments.
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t VIRTUAL_LOG_N
static size_t calc_num_data_types()
Calculate the number of field elements needed for serialization.
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS
The VerifierInstance encapsulates all the necessary information for a Mega Honk Verifier to verify a ...
Manages the data that is propagated on the public inputs of an application/function circuit.
Manages the data that is propagated on the public inputs of a hiding kernel circuit.
Manages the data that is propagated on the public inputs of a kernel circuit.
The stdlib counterpart of VerifierInstance, used in recursive folding verification.
uint8_t buffer[RANDOM_BUFFER_SIZE]
UltraKeccakFlavor::VerificationKey VerificationKey
DefaultIO< MegaCircuitBuilder > AppIO
The data that is propagated on the public inputs of an application/function circuit.
Entry point for Barretenberg command-line interface.
std::vector< fr > HonkProof
void write(std::vector< uint8_t > &buf, Chonk::VerificationKey const &vk)
void read(uint8_t const *&it, Chonk::VerificationKey &vk)
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
MegaCircuitBuilder_< field< Bn254FrParams > > MegaCircuitBuilder
VerifierCommitmentKey< Curve > vk
void read(auto &it, msgpack_concepts::HasMsgPack auto &obj)
Automatically derived read for any object that defines .msgpack() (implicitly defined by MSGPACK_FIEL...
void write(auto &buf, const msgpack_concepts::HasMsgPack auto &obj)
Automatically derived write for any object that defines .msgpack() (implicitly defined by MSGPACK_FIE...
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
A full proof for the IVC scheme containing a Mega proof showing correctness of the Hiding kernel (whi...
void to_file_msgpack(const std::string &filename) const
static constexpr const char MSGPACK_SCHEMA_NAME[]
static Proof from_msgpack_buffer(uint8_t const *&buffer)
bool operator==(const Proof &other) const =default
MSGPACK_FIELDS(mega_proof, goblin_proof)
static Proof from_file_msgpack(const std::string &filename)
static constexpr size_t PROOF_LENGTH(size_t virtual_log_n=MegaZKFlavor::VIRTUAL_LOG_N)
The size of a Chonk proof with backend-added public inputs: HidingKernelIO.
static Proof from_field_elements(const std::vector< Chonk::FF > &fields)
std::vector< FF > to_field_elements() const
Serialize proof to field elements.
uint8_t * to_msgpack_heap_buffer() const
Very quirky method to convert a msgpack buffer to a "heap" buffer.
msgpack::sbuffer to_msgpack_buffer() const
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=MegaZKFlavor::VIRTUAL_LOG_N)
The size of a Chonk proof without backend-added public inputs.
static size_t calc_num_data_types()
Calculate the number of field elements needed for serialization.
std::shared_ptr< ECCVMVerificationKey > eccvm
size_t from_field_elements(std::span< const bb::fr > elements)
Deserialize verification key from field elements.
std::shared_ptr< TranslatorVerificationKey > translator
std::vector< bb::fr > to_field_elements() const
Serialize verification key to field elements.
std::shared_ptr< MegaVerificationKey > mega
An object storing two EC points that represent the inputs to a pairing check.