Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_verifier.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Complete, auditors: [Sergei], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
16
17namespace bb {
18
23template <typename Flavor> class TranslatorVerifier_ {
24 public:
25 using FF = typename Flavor::FF;
26 using BF = typename Flavor::BF;
27 using Curve = typename Flavor::Curve;
34
35 static constexpr bool IsRecursive = Curve::is_stdlib_type;
37
38 // Use stdlib PairingPoints for recursive, native PairingPoints for native
41
42 // Proof type: stdlib::Proof for recursive, HonkProof for native
44
51 PairingPoints pairing_points; // KZG pairing points for deferred verification
52 bool reduction_succeeded = false; // Aggregate of sumcheck and consistency checks
53 };
54
67 TranslatorVerifier_(std::shared_ptr<Transcript> transcript,
68 const Proof& proof,
72 const std::array<Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES>& op_queue_wire_commitments)
73 : transcript(std::move(transcript))
74 , proof(proof)
79 {
80 // Translator VK is constant
82 if constexpr (IsRecursive) {
83 builder = proof.back().get_context();
85 vk_hash = key->get_hash();
86 } else {
87 key = native_vk;
88 vk_hash = native_vk->get_hash();
89 }
90 }
91
105 [[nodiscard("Verification result should be checked")]] ReductionResult reduce_to_pairing_check();
106
111 std::shared_ptr<VerificationKey> get_verification_key() const { return key; }
112
113 private:
114 std::shared_ptr<VerificationKey> key;
116 std::shared_ptr<Transcript> transcript;
119
120 // Translation inputs from ECCVM verifier
124 std::array<Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES> op_queue_wire_commitments;
125
126 // Builder pointer (only used for recursive, nullptr for native)
128
138};
139
140// Type aliases
143
144} // namespace bb
A container for commitment labels.
typename Curve::ScalarField FF
VerifierCommitments_< Commitment, VerificationKey > VerifierCommitments
typename G1::affine_element Commitment
typename Curve::BaseField BF
curve::Grumpkin Curve
FixedVKAndHash_< PrecomputedEntities< Commitment >, BF, ECCVMHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
BaseTranscript< Codec, HashFunction > Transcript
An object storing two EC points that represent the inputs to a pairing check.
Translator verifier class that verifies the proof of the Translator circuit.
ReductionResult reduce_to_pairing_check()
Reduce the translator proof to a pairing check.
typename Flavor::Transcript Transcript
typename Flavor::VerificationKey VerificationKey
void put_translation_data_in_relation_parameters()
Populate relation parameters with translation data from ECCVM verifier.
std::conditional_t< IsRecursive, Builder *, void * > builder
std::conditional_t< IsRecursive, typename Flavor::CircuitBuilder, void > Builder
std::conditional_t< IsRecursive, stdlib::Proof< Builder >, HonkProof > Proof
TranslatorVerifier_(std::shared_ptr< Transcript > transcript, const Proof &proof, const BF &evaluation_input_x, const BF &batching_challenge_v, const BF &accumulated_result, const std::array< Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES > &op_queue_wire_commitments)
Unified constructor for both native and recursive verification.
typename Flavor::VerifierCommitments VerifierCommitments
std::shared_ptr< VerificationKey > get_verification_key() const
Get the verification key.
std::array< Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES > op_queue_wire_commitments
std::shared_ptr< VerificationKey > key
std::shared_ptr< Transcript > transcript
std::conditional_t< IsRecursive, stdlib::recursion::PairingPoints< Curve >, bb::PairingPoints< Curve > > PairingPoints
typename Flavor::CommitmentLabels CommitmentLabels
typename Flavor::Commitment Commitment
typename Flavor::Curve Curve
static constexpr bool IsRecursive
static constexpr bool is_stdlib_type
Definition grumpkin.hpp:69
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
std::vector< fr > HonkProof
Definition proof.hpp:15
STL namespace.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Result of reducing translator proof to pairing check.