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 // Extract builder from proof - safe since transcript cannot hash non-witness elements
84 builder = proof.back().get_context();
86 vk_hash = stdlib::witness_t<Builder>(builder, native_vk->hash());
87 key->fix_witness();
88 vk_hash.fix_witness();
89 } else {
90 key = native_vk;
91 vk_hash = native_vk->hash();
92 }
93 }
94
108 [[nodiscard("Verification result should be checked")]] ReductionResult reduce_to_pairing_check();
109
114 std::shared_ptr<VerificationKey> get_verification_key() const { return key; }
115
116 private:
117 std::shared_ptr<VerificationKey> key;
119 std::shared_ptr<Transcript> transcript;
122
123 // Translation inputs from ECCVM verifier
127 std::array<Commitment, TranslatorFlavor::NUM_OP_QUEUE_WIRES> op_queue_wire_commitments;
128
129 // Builder pointer (only used for recursive, nullptr for native)
131
141};
142
143// Type aliases
146
147} // namespace bb
A container for commitment labels.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
typename Curve::ScalarField FF
VerifierCommitments_< Commitment, VerificationKey > VerifierCommitments
typename G1::affine_element Commitment
typename Curve::BaseField BF
curve::Grumpkin Curve
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.