46 using Point = Flavor::Curve::AffineElement;
151 :
std::runtime_error(
std::string(
"Client IVC Proof deserialization error: ") + msg)
188 auto mega_elements =
mega->to_field_elements();
189 elements.insert(elements.end(), mega_elements.begin(), mega_elements.end());
191 auto eccvm_elements =
eccvm->to_field_elements();
192 elements.insert(elements.end(), eccvm_elements.begin(), eccvm_elements.end());
194 auto translator_elements =
translator->to_field_elements();
195 elements.insert(elements.end(), translator_elements.begin(), translator_elements.end());
210 size_t mega_read =
mega->from_field_elements(elements.subspan(read_idx));
211 read_idx += mega_read;
214 size_t eccvm_read =
eccvm->from_field_elements(elements.subspan(read_idx));
215 read_idx += eccvm_read;
218 size_t translator_read =
translator->from_field_elements(elements.subspan(read_idx));
219 read_idx += translator_read;
269 std::shared_ptr<VerifierInstance>
297 const std::vector<std::shared_ptr<RecursiveVKAndHash>>& input_keys = {});
299 [[nodiscard(
"Pairing points should be accumulated")]]
std::
303 const StdlibVerifierInputs& verifier_inputs,
341 const std::shared_ptr<Transcript>& verifier_transcript);
345 const std::shared_ptr<Transcript>&
transcript);
349 const std::shared_ptr<Transcript>&
transcript,
378 size_t num_frs = ClientIVC::VerificationKey::calc_num_data_types();
382 for (
auto& element : field_elements) {
387 vk.from_field_elements(field_elements);
395 auto field_elements =
vk.to_field_elements();
396 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.
Proof prove()
Construct a proof for the IVC, which, if verified, fully establishes its correctness.
static void hide_op_queue_accumulation_result(ClientCircuit &circuit)
Add a valid operation with random data to the op queue to prevent information leakage in Translator p...
static void hide_op_queue_content_in_tail(ClientCircuit &circuit)
Adds three random ops to the tail kernel.
MegaFlavor::CommitmentKey bn254_commitment_key
TraceSettings trace_settings
std::deque< VerifierInputs > VerificationQueue
std::shared_ptr< Transcript > prover_accumulation_transcript
ExecutionTraceUsageTracker trace_usage_tracker
HonkProof construct_honk_proof_for_hiding_kernel(ClientCircuit &circuit, const std::shared_ptr< MegaVerificationKey > &verification_key)
Construct a zero-knowledge proof for the hiding circuit, which recursively verifies the last folding,...
std::deque< StdlibVerifierInputs > StdlibVerificationQueue
std::shared_ptr< VerifierInstance > recursive_verifier_native_accum
HonkProof construct_decider_proof(const std::shared_ptr< Transcript > &transcript)
Internal method for constructing a decider proof.
std::shared_ptr< ProverInstance > prover_accumulator
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...
VerificationKey get_vk() const
Goblin & get_goblin() override
std::tuple< std::shared_ptr< RecursiveVerifierInstance >, PairingPoints, TableCommitments > perform_recursive_verification_and_databus_consistency_checks(ClientCircuit &circuit, const StdlibVerifierInputs &verifier_inputs, const std::shared_ptr< RecursiveVerifierInstance > &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...
static void hide_op_queue_content_in_hiding(ClientCircuit &circuit)
Adds two random ops to the hiding kernel.
static std::shared_ptr< RecursiveVerifierInstance > perform_oink_recursive_verification(ClientCircuit &circuit, const std::shared_ptr< RecursiveVerifierInstance > &verifier_instance, const std::shared_ptr< RecursiveTranscript > &transcript, const StdlibProof &proof)
void complete_kernel_circuit_logic(ClientCircuit &circuit)
Append logic to complete a kernel circuit.
Flavor::Curve::AffineElement Point
void accumulate(ClientCircuit &circuit, const std::shared_ptr< MegaVerificationKey > &precomputed_vk) override
Perform prover work for accumulation (e.g. PG folding, merge proving)
HonkProof construct_pg_proof(const std::shared_ptr< ProverInstance > &prover_instance, const std::shared_ptr< MegaVerificationKey > &honk_vk, const std::shared_ptr< Transcript > &transcript, bool is_kernel)
size_t get_num_circuits() const
size_t num_circuits_accumulated
void update_native_verifier_accumulator(const VerifierInputs &queue_entry, const std::shared_ptr< Transcript > &verifier_transcript)
Runs either Oink or PG native verifier to update the native verifier accumulator.
const Goblin & get_goblin() const override
stdlib::Proof< ClientCircuit > StdlibProof
VerificationQueue verification_queue
HonkProof construct_oink_proof(const std::shared_ptr< ProverInstance > &prover_instance, const std::shared_ptr< MegaVerificationKey > &honk_vk, const std::shared_ptr< Transcript > &transcript)
std::vector< FF > FoldProof
std::shared_ptr< VerifierInstance > native_verifier_accum
StdlibVerificationQueue stdlib_verification_queue
MegaCircuitBuilder ClientCircuit
std::array< RecursiveFlavor::Commitment, ClientCircuit::NUM_WIRES > TableCommitments
std::shared_ptr< Transcript > transcript
static bool verify(const Proof &proof, const VerificationKey &vk)
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.
RecursiveFlavor::FF StdlibFF
stdlib::recursion::PairingPoints< ClientCircuit > PairingPoints
static std::shared_ptr< RecursiveVerifierInstance > perform_pg_recursive_verification(ClientCircuit &circuit, const std::shared_ptr< RecursiveVerifierInstance > &verifier_accumulator, const std::shared_ptr< RecursiveVerifierInstance > &verifier_instance, const std::shared_ptr< RecursiveTranscript > &transcript, const StdlibProof &proof, std::optional< StdlibFF > &prev_accum_hash, bool is_kernel)
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
Base class interface for IVC schemes.
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.
static constexpr size_t VIRTUAL_LOG_N
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::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=MegaFlavor::VIRTUAL_LOG_N)
static size_t calc_num_data_types()
Calculate the number of field elements needed for serialization.
Verifier class for all the presumcheck rounds, which are shared between the folding verifier and ultr...
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, ClientIVC::VerificationKey const &vk)
void read(uint8_t const *&it, ClientIVC::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 circuit (wh...
static constexpr const char MSGPACK_SCHEMA_NAME[]
void to_file_msgpack(const std::string &filename) const
static Proof from_msgpack_buffer(uint8_t const *&buffer)
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.
static constexpr size_t PROOF_LENGTH(size_t virtual_log_n=MegaZKFlavor::VIRTUAL_LOG_N)
The size of a ClientIVC proof with backend-added public inputs: HidingKernelIO.
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=MegaZKFlavor::VIRTUAL_LOG_N)
The size of a ClientIVC proof without backend-added public inputs.
static Proof from_file_msgpack(const std::string &filename)
msgpack::sbuffer to_msgpack_buffer() const
static Proof from_field_elements(const std::vector< ClientIVC::FF > &fields)
bool operator==(const Proof &other) const =default
MSGPACK_FIELDS(mega_proof, goblin_proof)
std::shared_ptr< ECCVMVerificationKey > eccvm
std::vector< bb::fr > to_field_elements() const
Serialize verification key to field elements.
size_t from_field_elements(std::span< const bb::fr > elements)
Deserialize verification key from field elements.
std::shared_ptr< MegaVerificationKey > mega
static size_t calc_num_data_types()
Calculate the number of field elements needed for serialization.
std::shared_ptr< TranslatorVerificationKey > translator
Tracks the cumulative usage of the execution trace across a series of circuits.
An object storing two EC points that represent the inputs to a pairing check.