Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::OinkVerifier< Flavor > Class Template Reference

Verifier counterpart to OinkProver: receives witness commitments, computes relation parameters, and prepares for Sumcheck. More...

#include <oink_verifier.hpp>

Public Member Functions

 OinkVerifier (const std::shared_ptr< Instance > &verifier_instance, const std::shared_ptr< Transcript > &transcript, size_t num_public_inputs)
 
void verify (bool emit_alpha=true)
 Receive witness commitments, compute relation parameters, and prepare for Sumcheck.
 

Private Types

using Transcript = typename Flavor::Transcript
 
using FF = typename Flavor::FF
 
using Commitment = typename Flavor::Commitment
 
using Instance = bb::VerifierInstance_< Flavor >
 

Private Member Functions

void receive_vk_hash_and_public_inputs ()
 Hash the verification key, assert consistency, and receive public inputs from the transcript.
 
void receive_wire_commitments ()
 Receive wire commitments (w_l, w_r, w_o). For Mega, also receive ECC op wire and DataBus commitments. The fourth wire (w_4) is received later, after memory records are incorporated.
 
void receive_lookup_counts_and_w4_commitments ()
 Get sorted witness-table accumulator and fourth wire commitments.
 
void receive_logderiv_commitments ()
 Receive beta/gamma challenges and log-derivative inverse commitments (plus databus inverses for Mega).
 
void complete_grand_product_round ()
 Compute public_input_delta for the permutation argument and receive z_perm commitment.
 

Private Attributes

std::shared_ptr< Transcripttranscript
 
std::shared_ptr< Instanceverifier_instance
 
Flavor::CommitmentLabels comm_labels
 
size_t num_public_inputs
 

Detailed Description

template<typename Flavor>
class bb::OinkVerifier< Flavor >

Verifier counterpart to OinkProver: receives witness commitments, computes relation parameters, and prepares for Sumcheck.

The rounds mirror OinkProver::prove() and proceed in order:

  1. receive_vk_hash_and_public_inputs – hash the VK, assert consistency, receive public inputs
  2. (ZK only) receive masking polynomial commitment
  3. receive_wire_commitments – receive w_l, w_r, w_o (plus ECC-op & databus for Mega)
  4. receive_lookup_counts_and_w4_commitments – get eta challenge, receive lookup counts/tags and w_4
  5. receive_logderiv_commitments – get beta/gamma challenges, receive log-derivative inverses (plus databus inverses for Mega)
  6. complete_grand_product_round – compute public_input_delta, receive z_perm
  7. get alpha challenge

Works with both native and recursive flavors. When instantiated with a recursive flavor (IsRecursiveFlavor<Flavor>), automatically handles the differences in VK access and VK hash assertion.

Definition at line 30 of file oink_verifier.hpp.

Member Typedef Documentation

◆ Commitment

template<typename Flavor >
using bb::OinkVerifier< Flavor >::Commitment = typename Flavor::Commitment
private

Definition at line 33 of file oink_verifier.hpp.

◆ FF

template<typename Flavor >
using bb::OinkVerifier< Flavor >::FF = typename Flavor::FF
private

Definition at line 32 of file oink_verifier.hpp.

◆ Instance

template<typename Flavor >
using bb::OinkVerifier< Flavor >::Instance = bb::VerifierInstance_<Flavor>
private

Definition at line 34 of file oink_verifier.hpp.

◆ Transcript

template<typename Flavor >
using bb::OinkVerifier< Flavor >::Transcript = typename Flavor::Transcript
private

Definition at line 31 of file oink_verifier.hpp.

Constructor & Destructor Documentation

◆ OinkVerifier()

template<typename Flavor >
bb::OinkVerifier< Flavor >::OinkVerifier ( const std::shared_ptr< Instance > &  verifier_instance,
const std::shared_ptr< Transcript > &  transcript,
size_t  num_public_inputs 
)
inline

Definition at line 37 of file oink_verifier.hpp.

Member Function Documentation

◆ complete_grand_product_round()

template<typename Flavor >
void bb::OinkVerifier< Flavor >::complete_grand_product_round ( )
private

Compute public_input_delta for the permutation argument and receive z_perm commitment.

Definition at line 144 of file oink_verifier.cpp.

◆ receive_logderiv_commitments()

template<typename Flavor >
void bb::OinkVerifier< Flavor >::receive_logderiv_commitments ( )
private

Receive beta/gamma challenges and log-derivative inverse commitments (plus databus inverses for Mega).

Definition at line 124 of file oink_verifier.cpp.

◆ receive_lookup_counts_and_w4_commitments()

template<typename Flavor >
void bb::OinkVerifier< Flavor >::receive_lookup_counts_and_w4_commitments ( )
private

Get sorted witness-table accumulator and fourth wire commitments.

Definition at line 108 of file oink_verifier.cpp.

◆ receive_vk_hash_and_public_inputs()

template<typename Flavor >
void bb::OinkVerifier< Flavor >::receive_vk_hash_and_public_inputs ( )
private

Hash the verification key, assert consistency, and receive public inputs from the transcript.

Definition at line 43 of file oink_verifier.cpp.

◆ receive_wire_commitments()

template<typename Flavor >
void bb::OinkVerifier< Flavor >::receive_wire_commitments ( )
private

Receive wire commitments (w_l, w_r, w_o). For Mega, also receive ECC op wire and DataBus commitments. The fourth wire (w_4) is received later, after memory records are incorporated.

Definition at line 82 of file oink_verifier.cpp.

◆ verify()

template<typename Flavor >
void bb::OinkVerifier< Flavor >::verify ( bool  emit_alpha = true)

Receive witness commitments, compute relation parameters, and prepare for Sumcheck.

Definition at line 23 of file oink_verifier.cpp.

Member Data Documentation

◆ comm_labels

template<typename Flavor >
Flavor::CommitmentLabels bb::OinkVerifier< Flavor >::comm_labels
private

Definition at line 53 of file oink_verifier.hpp.

◆ num_public_inputs

template<typename Flavor >
size_t bb::OinkVerifier< Flavor >::num_public_inputs
private

Definition at line 54 of file oink_verifier.hpp.

◆ transcript

template<typename Flavor >
std::shared_ptr<Transcript> bb::OinkVerifier< Flavor >::transcript
private

Definition at line 51 of file oink_verifier.hpp.

◆ verifier_instance

template<typename Flavor >
std::shared_ptr<Instance> bb::OinkVerifier< Flavor >::verifier_instance
private

Definition at line 52 of file oink_verifier.hpp.


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