|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Executes the "Oink" phase of the Honk proving protocol: the initial rounds that commit to witness data, lookup/logderivative inverses, and the permutation grand product, producing the relation parameters (eta, beta, gamma, alpha) along the way. More...
#include <oink_prover.hpp>
Public Member Functions | |
| OinkProver (std::shared_ptr< ProverInstance > prover_instance, std::shared_ptr< HonkVK > honk_vk, const std::shared_ptr< typename Flavor::Transcript > &transcript) | |
| void | prove (bool emit_alpha=true) |
| Commit to witnesses, compute relation parameters, and prepare for Sumcheck. | |
| Proof | export_proof () |
| Export the Oink proof. | |
Static Public Member Functions | |
| static void | add_ram_rom_memory_records_to_wire_4 (ProverInstance &instance) |
| Add RAM/ROM memory records to the fourth wire polynomial. | |
| static void | add_rom_logup_inverses_to_wire_4 (ProverInstance &instance) |
| Populate the inverse helper w_4 = 1 / (rom_logup_gamma + w_1 + eta * w_2 + eta_two * q_c) at every ROM-LogUp row. | |
| static void | compute_logderivative_inverses (ProverInstance &instance) |
| Compute the inverse polynomials used in the log derivative lookup relations. | |
| static void | compute_grand_product_polynomial (ProverInstance &instance, uint32_t &z_perm_dup_count) |
| Computes public_input_delta and the permutation grand product polynomial. | |
Private Types | |
| using | CommitmentKey = typename Flavor::CommitmentKey |
| using | HonkVK = typename Flavor::VerificationKey |
| using | ProverInstance = ProverInstance_< Flavor > |
| using | Transcript = typename Flavor::Transcript |
| using | FF = typename Flavor::FF |
| using | Proof = typename Transcript::Proof |
| using | EntityId = typename Flavor::ProverPolynomials::EntityId |
Private Member Functions | |
| void | send_vk_hash_and_public_inputs () |
| Hash the verification key and send public inputs to the transcript. | |
| void | commit_to_wires () |
| Commit to the wire polynomials (part of the witness), with the exception of the fourth wire, which is only committed to after adding memory records. For Mega, we also commit to the ECC op wires and DataBus columns. | |
| void | commit_to_lookup_counts_and_w4 () |
| Compute sorted witness-table accumulator and commit to the resulting polynomials. | |
| void | commit_to_logderiv_inverses () |
| Compute log derivative inverse polynomial and its commitment, if required. | |
| void | commit_to_z_perm () |
| Compute the permutation grand product polynomial and commit to it. | |
| void | commit_to_masking_poly () |
Private Attributes | |
| std::shared_ptr< ProverInstance > | prover_instance |
| std::shared_ptr< HonkVK > | honk_vk |
| std::shared_ptr< Transcript > | transcript |
| CommitmentKey | commitment_key |
| Flavor::CommitmentLabels | commitment_labels |
Executes the "Oink" phase of the Honk proving protocol: the initial rounds that commit to witness data, lookup/logderivative inverses, and the permutation grand product, producing the relation parameters (eta, beta, gamma, alpha) along the way.
The rounds proceed in order:
After prove() completes, the prover instance holds all committed polynomials and relation parameters needed by the subsequent Sumcheck and PCS phases in UltraProver.
The underlying witness computations (RAM/ROM memory records, log-derivative inverses, permutation grand product) are also exposed as public static methods so that test code can invoke them independently of the transcript-driven commit flow.
Definition at line 52 of file oink_prover.hpp.
|
private |
Definition at line 53 of file oink_prover.hpp.
|
private |
Definition at line 59 of file oink_prover.hpp.
|
private |
Definition at line 57 of file oink_prover.hpp.
|
private |
Definition at line 54 of file oink_prover.hpp.
|
private |
Definition at line 58 of file oink_prover.hpp.
|
private |
Definition at line 55 of file oink_prover.hpp.
|
private |
Definition at line 56 of file oink_prover.hpp.
|
inline |
Definition at line 62 of file oink_prover.hpp.
|
static |
Add RAM/ROM memory records to the fourth wire polynomial.
This operation must be performed after the first three wires have been committed to, hence the dependence on the eta challenge.
| Flavor |
| instance | prover instance whose polynomials, memory records, and eta powers are used |
Definition at line 261 of file oink_prover.cpp.
|
static |
Populate the inverse helper w_4 = 1 / (rom_logup_gamma + w_1 + eta * w_2 + eta_two * q_c) at every ROM-LogUp row.
This operation must be performed after the eta and rom_logup_gamma challenges have been generated but before w_4 is committed to. (See the ROM LogUp subrelations in the Memory relation for details.)
| Flavor |
| instance | prover instance whose polynomials, rom_logup_records, and challenges are used |
Definition at line 298 of file oink_prover.cpp.
|
private |
Compute log derivative inverse polynomial and its commitment, if required.
Definition at line 170 of file oink_prover.cpp.
|
private |
Compute sorted witness-table accumulator and commit to the resulting polynomials.
Definition at line 129 of file oink_prover.cpp.
|
private |
Definition at line 233 of file oink_prover.cpp.
|
private |
Commit to the wire polynomials (part of the witness), with the exception of the fourth wire, which is only committed to after adding memory records. For Mega, we also commit to the ECC op wires and DataBus columns.
Definition at line 83 of file oink_prover.cpp.
|
private |
Compute the permutation grand product polynomial and commit to it.
Definition at line 216 of file oink_prover.cpp.
|
static |
Computes public_input_delta and the permutation grand product polynomial.
| instance | prover instance whose polynomials, public inputs, and relation parameters are used |
Definition at line 360 of file oink_prover.cpp.
|
static |
Compute the inverse polynomials used in the log derivative lookup relations.
| Flavor |
| instance | prover instance whose polynomials and relation parameters are used |
Definition at line 331 of file oink_prover.cpp.
| OinkProver< Flavor >::Proof bb::OinkProver< Flavor >::export_proof | ( | ) |
Export the Oink proof.
Definition at line 58 of file oink_prover.cpp.
| void bb::OinkProver< Flavor >::prove | ( | bool | emit_alpha = true | ) |
Commit to witnesses, compute relation parameters, and prepare for Sumcheck.
Definition at line 35 of file oink_prover.cpp.
|
private |
Hash the verification key and send public inputs to the transcript.
Definition at line 66 of file oink_prover.cpp.
|
private |
Definition at line 88 of file oink_prover.hpp.
|
private |
Definition at line 89 of file oink_prover.hpp.
|
private |
Definition at line 86 of file oink_prover.hpp.
|
private |
Definition at line 85 of file oink_prover.hpp.
|
private |
Definition at line 87 of file oink_prover.hpp.