Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
oink_prover.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Completed, auditors: [Sergei], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8// clang-format off
9/* )\ /|
10* .-/'-|_/ |
11* __ __,-' ( / \/
12* .-'" "'-..__,-'"" -o.`-._
13* / '/
14* *--._ ./ _.--
15* | _.-'
16* : .-/
17* \ )_ /
18* \ _) / \‍(
19* `. /-.___.---'( / \\
20* ( / \\ \‍( L\
21* \‍( L\ \\
22* \\ \\
23* L\ L\
24*/
25// clang-format on
27
28namespace bb {
52template <typename Flavor> class OinkProver {
57 using FF = typename Flavor::FF;
58 using Proof = typename Transcript::Proof;
59
60 public:
68
69 // emit_alpha: when false, skip drawing the "alpha" challenge at the end of Oink.
70 // Used by BatchedHonkTranslatorProver, which draws a single joint alpha ("Sumcheck:alpha")
71 // after both circuits' pre-sumcheck phases instead.
72 void prove(bool emit_alpha = true);
74
78
79 private:
81 std::shared_ptr<HonkVK> honk_vk;
82 std::shared_ptr<Transcript> transcript;
86 void commit_to_wires();
89 void commit_to_z_perm();
91};
92
94
95} // namespace bb
std::shared_ptr< Napi::ThreadSafeFunction > instance
std::vector< DataType > Proof
A container for commitment labels.
typename Curve::ScalarField FF
bb::CommitmentKey< Curve > CommitmentKey
FixedVKAndHash_< PrecomputedEntities< Commitment >, BF, ECCVMHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
BaseTranscript< Codec, HashFunction > Transcript
Executes the "Oink" phase of the Honk proving protocol: the initial rounds that commit to witness dat...
void prove(bool emit_alpha=true)
Commit to witnesses, compute relation parameters, and prepare for Sumcheck.
Proof export_proof()
Export the Oink proof.
static void compute_logderivative_inverses(ProverInstance &instance)
Compute the inverse polynomials used in the log derivative lookup relations.
void commit_to_logderiv_inverses()
Compute log derivative inverse polynomial and its commitment, if required.
void send_vk_hash_and_public_inputs()
Hash the verification key and send public inputs to the transcript.
CommitmentKey commitment_key
typename Flavor::Transcript Transcript
std::shared_ptr< ProverInstance > prover_instance
Flavor::CommitmentLabels commitment_labels
typename Flavor::VerificationKey HonkVK
static void add_ram_rom_memory_records_to_wire_4(ProverInstance &instance)
Add RAM/ROM memory records to the fourth wire polynomial.
typename Flavor::CommitmentKey CommitmentKey
typename Flavor::FF FF
void commit_to_lookup_counts_and_w4()
Compute sorted witness-table accumulator and commit to the resulting polynomials.
std::shared_ptr< Transcript > transcript
OinkProver(std::shared_ptr< ProverInstance > prover_instance, std::shared_ptr< HonkVK > honk_vk, const std::shared_ptr< typename Flavor::Transcript > &transcript)
void commit_to_z_perm()
Compute the permutation grand product polynomial and commit to it.
static void compute_grand_product_polynomial(ProverInstance &instance)
Computes public_input_delta and the permutation grand product polynomial.
void commit_to_masking_poly()
std::shared_ptr< HonkVK > honk_vk
void commit_to_wires()
Commit to the wire polynomials (part of the witness), with the exception of the fourth wire,...
typename Transcript::Proof Proof
Contains all the information required by a Honk prover to create a proof, constructed from a finalize...
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13