barretenberg
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
proof_system::plonk::StandardComposer Class Reference

Public Types

using Flavor = plonk::flavor::Standard
 
using CircuitBuilder = StandardCircuitBuilder
 

Public Member Functions

 StandardComposer (std::shared_ptr< barretenberg::srs::factories::CrsFactory< curve::BN254 > > crs_factory)
 
 StandardComposer (std::unique_ptr< barretenberg::srs::factories::CrsFactory< curve::BN254 > > &&crs_factory)
 
 StandardComposer (std::shared_ptr< plonk::proving_key > p_key, std::shared_ptr< plonk::verification_key > v_key)
 
 StandardComposer (StandardComposer &&other) noexcept=default
 
 StandardComposer (const StandardComposer &other)=delete
 
StandardComposeroperator= (StandardComposer &&other) noexcept=default
 
StandardComposeroperator= (const StandardComposer &other)=delete
 
std::vector< SelectorPropertiesstandard_selector_properties ()
 
std::shared_ptr< plonk::proving_keycompute_proving_key (const CircuitBuilder &circuit_constructor)
 
std::shared_ptr< plonk::verification_keycompute_verification_key (const CircuitBuilder &circuit_constructor)
 
plonk::Verifier create_verifier (const CircuitBuilder &circuit_constructor)
 
plonk::Prover create_prover (const CircuitBuilder &circuit_constructor)
 
void compute_witness (const CircuitBuilder &circuit_constructor, const size_t minimum_circuit_size=0)
 

Static Public Member Functions

static transcript::Manifest create_manifest (const size_t num_public_inputs)
 

Public Attributes

std::shared_ptr< plonk::proving_keycircuit_proving_key
 
std::shared_ptr< plonk::verification_keycircuit_verification_key
 
std::shared_ptr< barretenberg::srs::factories::CrsFactory< curve::BN254 > > crs_factory_
 
bool computed_witness = false
 

Static Public Attributes

static constexpr std::string_view NAME_STRING = "StandardPlonk"
 
static constexpr size_t NUM_RESERVED_GATES = 4
 
static constexpr size_t program_width = CircuitBuilder::program_width
 

Member Function Documentation

◆ compute_proving_key()

std::shared_ptr< plonk::proving_key > proof_system::plonk::StandardComposer::compute_proving_key ( const CircuitBuilder circuit_constructor)

Compute proving key

  1. Load crs.
  2. Initialize this.circuit_proving_key.
  3. Create constraint selector polynomials from each of this composer's selectors vectors and add them to the proving key.
  4. Compute sigma polynomial
Returns
Pointer to the initialized proving key updated with selector polynomials.

◆ compute_verification_key()

std::shared_ptr< plonk::verification_key > proof_system::plonk::StandardComposer::compute_verification_key ( const CircuitBuilder circuit_constructor)

Compute verification key consisting of selector precommitments.

Returns
Pointer to created circuit verification key.

◆ compute_witness()

void proof_system::plonk::StandardComposer::compute_witness ( const CircuitBuilder circuit_constructor,
const size_t  minimum_circuit_size = 0 
)

Compute witness polynomials (w_1, w_2, w_3, w_4).

Fills 3 or 4 witness polynomials w_1, w_2, w_3, w_4 with the values of in-circuit variables. The beginning of w_1, w_2 polynomials is filled with public_input values.

Returns
Witness with computed witness polynomials.
Template Parameters
Programsettings needed to establish if w_4 is being used.

◆ create_manifest()

static transcript::Manifest proof_system::plonk::StandardComposer::create_manifest ( const size_t  num_public_inputs)
inlinestatic

Create a manifest, which specifies proof rounds, elements and who supplies them.

Parameters
num_public_inputsThe number of public inputs.
Returns
Constructed manifest.

◆ create_prover()

plonk::Prover proof_system::plonk::StandardComposer::create_prover ( const CircuitBuilder circuit_constructor)

Create prover.

  1. Compute the starting polynomials (q_l, etc, sigma, witness polynomials).
  2. Initialize StandardProver with them.
  3. Add Permutation and arithmetic widgets to the prover.
  4. Add KateCommitmentScheme to the prover.
Returns
Initialized prover.

◆ create_verifier()

plonk::Verifier proof_system::plonk::StandardComposer::create_verifier ( const CircuitBuilder circuit_constructor)

Create verifier: compute verification key, initialize verifier with it and an initial manifest and initialize commitment_scheme.

Returns
The verifier.

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