Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
acir_format::ProofSurgeon< FF > Class Template Reference

#include <proof_surgeon.hpp>

Classes

struct  RecursionWitnessData
 

Static Public Member Functions

static std::vector< uint32_t > create_indices_for_reconstructed_proof (const std::vector< uint32_t > &proof_in, const std::vector< uint32_t > &public_inputs)
 Reconstruct a bberg style proof from a acir style proof + public inputs.
 
static std::vector< FFcut_public_inputs_from_proof (std::vector< FF > &proof_witnesses, const size_t num_public_inputs_to_extract)
 Extract then remove a given number of public inputs from a proof.
 
static std::vector< uint32_t > get_public_inputs_witness_indices_from_proof (const bb::stdlib::Proof< bb::MegaCircuitBuilder > &proof, const size_t num_public_inputs_to_extract)
 Get the witness indices for a given number of public inputs contained within a stdlib proof.
 
static RecursionWitnessData populate_recursion_witness_data (bb::SlabVector< FF > &witness, std::vector< FF > &proof_witnesses, const std::vector< FF > &key_witnesses, const FF &key_hash_witness, const size_t num_public_inputs_to_extract)
 Populate a witness vector with key, proof, and public inputs; track witness indices for each component.
 

Detailed Description

template<typename FF>
class acir_format::ProofSurgeon< FF >

Definition at line 22 of file proof_surgeon.hpp.

Member Function Documentation

◆ create_indices_for_reconstructed_proof()

template<typename FF >
static std::vector< uint32_t > acir_format::ProofSurgeon< FF >::create_indices_for_reconstructed_proof ( const std::vector< uint32_t > &  proof_in,
const std::vector< uint32_t > &  public_inputs 
)
inlinestatic

Reconstruct a bberg style proof from a acir style proof + public inputs.

Insert the public inputs in the middle the proof fields after 'inner_public_input_offset' because this is how the core barretenberg library processes proofs (with the public inputs starting at the third element and not separate from the rest of the proof)

Parameters
proof_inA proof stripped of its public inputs
public_inputsThe public inputs to be reinserted into the proof
Returns
std::vector<uint32_t> The witness indices of the complete proof

Definition at line 34 of file proof_surgeon.hpp.

◆ cut_public_inputs_from_proof()

template<typename FF >
static std::vector< FF > acir_format::ProofSurgeon< FF >::cut_public_inputs_from_proof ( std::vector< FF > &  proof_witnesses,
const size_t  num_public_inputs_to_extract 
)
inlinestatic

Extract then remove a given number of public inputs from a proof.

Parameters
proof_witnessesWitness values of a bberg style proof containing public inputs
num_public_inputsThe number of public inputs to extract from the proof
Returns
std::vector<FF> The extracted public input witness values

Definition at line 54 of file proof_surgeon.hpp.

◆ get_public_inputs_witness_indices_from_proof()

template<typename FF >
static std::vector< uint32_t > acir_format::ProofSurgeon< FF >::get_public_inputs_witness_indices_from_proof ( const bb::stdlib::Proof< bb::MegaCircuitBuilder > &  proof,
const size_t  num_public_inputs_to_extract 
)
inlinestatic

Get the witness indices for a given number of public inputs contained within a stdlib proof.

Parameters
proofA bberg style stdlib proof (contains public inputs)
num_public_inputsThe number of public input witness indices to get from the proof
Returns
std::vector<FF> The corresponding public input witness indices

Definition at line 77 of file proof_surgeon.hpp.

◆ populate_recursion_witness_data()

template<typename FF >
static RecursionWitnessData acir_format::ProofSurgeon< FF >::populate_recursion_witness_data ( bb::SlabVector< FF > &  witness,
std::vector< FF > &  proof_witnesses,
const std::vector< FF > &  key_witnesses,
const FF key_hash_witness,
const size_t  num_public_inputs_to_extract 
)
inlinestatic

Populate a witness vector with key, proof, and public inputs; track witness indices for each component.

This method is used to constuct acir-style inputs to a recursion constraint. It is assumed that the provided proof contains all of its public inputs (i.e. the conventional bberg format) which are extracted herein. Each component is appended to the witness which may already contain data. The order in which they are added is arbitrary as long as the corresponding witness indices are correct.

Parameters
witness
proof_witnesses
key_witnesses
num_public_inputs
Returns
RecursionWitnessData

Definition at line 112 of file proof_surgeon.hpp.


The documentation for this class was generated from the following file: