Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
oink_verifier.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8
11
12namespace bb {
13
14// Helper to select the correct instance type without violating template constraints
15template <typename Flavor, bool = IsRecursiveFlavor<Flavor>> struct OinkVerifierInstanceType {
17};
18
22
35template <typename Flavor> class OinkVerifier {
38 using FF = typename Flavor::FF;
41
42 // Use appropriate instance type based on whether flavor is recursive
44
45 public:
46 std::shared_ptr<Transcript> transcript;
47 std::shared_ptr<Instance> verifier_instance;
48 std::string domain_separator;
52
53 OinkVerifier(const std::shared_ptr<Instance>& verifier_instance,
54 const std::shared_ptr<Transcript>& transcript,
55 std::string domain_separator = "")
59 {}
60
61 void verify();
62
64
66
68
70
72
74
75 private:
80 size_t get_num_public_inputs() const
81 {
82 auto vk = verifier_instance->get_vk();
83 if constexpr (IsRecursiveFlavor<Flavor>) {
84 return static_cast<size_t>(static_cast<uint32_t>(vk->num_public_inputs.get_value()));
85 } else {
86 return static_cast<size_t>(vk->num_public_inputs);
87 }
88 }
89};
90} // namespace bb
A container for commitment labels.
WitnessEntities< Commitment > WitnessCommitments
A container for the witness commitments.
Curve::ScalarField FF
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
NativeTranscript Transcript
Curve::AffineElement Commitment
Verifier class for all the presumcheck rounds, which are shared between the folding verifier and ultr...
typename Flavor::Transcript Transcript
WitnessCommitments witness_comms
Flavor::CommitmentLabels comm_labels
typename OinkVerifierInstanceType< Flavor >::type Instance
void execute_wire_commitments_round()
Get the wire polynomials (part of the witness), with the exception of the fourth wire,...
size_t get_num_public_inputs() const
Helper to get number of public inputs, abstracting differences between native and recursive flavors.
typename Flavor::FF FF
void execute_preamble_round()
Get circuit size, public input size, and public inputs from transcript.
void verify()
Oink Verifier function that runs all the rounds of the verifier.
std::shared_ptr< Transcript > transcript
SubrelationSeparators generate_alphas_round()
void execute_log_derivative_inverse_round()
Get log derivative inverse polynomial and its commitment, if MegaFlavor.
OinkVerifier(const std::shared_ptr< Instance > &verifier_instance, const std::shared_ptr< Transcript > &transcript, std::string domain_separator="")
bb::RelationParameters< FF > relation_parameters
typename Flavor::SubrelationSeparators SubrelationSeparators
void execute_grand_product_computation_round()
Compute lookup grand product delta and get permutation and lookup grand product commitments.
std::shared_ptr< Instance > verifier_instance
typename Flavor::Commitment Commitment
std::string domain_separator
typename Flavor::WitnessCommitments WitnessCommitments
void execute_sorted_list_accumulator_round()
Get sorted witness-table accumulator and fourth wire commitments.
The VerifierInstance encapsulates all the necessary information for a Mega Honk Verifier to verify a ...
The stdlib counterpart of VerifierInstance, used in recursive folding verification.
Entry point for Barretenberg command-line interface.
VerifierCommitmentKey< Curve > vk
STL namespace.
Container for parameters used by the grand product (permutation, lookup) Honk relations.