Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder > Class Template Reference

#include <recursive_flavor.hpp>

Inheritance diagram for bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >:
bb::BaseTranscript< Codec_, HashFunction_ >

Static Public Member Functions

static stdlib::field_t< Builderhash_avm_transcript (Builder &builder, const stdlib::Proof< Builder > &stdlib_proof, const std::vector< std::vector< stdlib::field_t< Builder > > > &public_inputs)
 Construct a transcript replicating the operations performed on the AVM transcript during proof verification. Then, hash the transcript to obtain the final state.
 
static stdlib::field_t< Builderhash_avm_transcript (const std::shared_ptr< TemplatedTranscript< Builder > > &transcript, const stdlib::Proof< Builder > &stdlib_proof)
 Hash the AVM verifier transcript after having performed proof verification. Then, hash the transcript to obtain the final state.
 
static std::pair< stdlib::field_t< Builder >, std::shared_ptr< TemplatedTranscript< Builder > > > hash_avm_transcript_for_testing (Builder &builder, const stdlib::Proof< Builder > &stdlib_proof, const std::vector< std::vector< stdlib::field_t< Builder > > > &public_inputs)
 Testing method to hash the transcript after having replicated the operations performed on the AVM transcript during proof verification and return both the final state and the transcript.
 
- Static Public Member Functions inherited from bb::BaseTranscript< Codec_, HashFunction_ >
static std::shared_ptr< BaseTranscriptconvert_prover_transcript_to_verifier_transcript (const std::shared_ptr< BaseTranscript > &prover_transcript)
 Convert a prover transcript to a verifier transcript.
 
template<typename T >
static std::vector< DataTypeserialize (const T &element)
 
template<typename T >
static T deserialize (std::span< const DataType > frs)
 
static std::shared_ptr< BaseTranscriptprover_init_empty ()
 For testing: initializes transcript with some arbitrary data so that a challenge can be generated after initialization. Only intended to be used by Prover.
 
static std::shared_ptr< BaseTranscriptverifier_init_empty (const std::shared_ptr< BaseTranscript > &transcript)
 For testing: initializes transcript based on proof data then receives junk data produced by BaseTranscript::prover_init_empty(). Only intended to be used by Verifier.
 

Private Types

using Base = StdlibTranscript< Builder >
 
using FF = stdlib::field_t< Builder >
 

Static Private Member Functions

static std::shared_ptr< TemplatedTranscript< Builder > > perform_avm_transcript_operations (Builder &builder, const stdlib::Proof< Builder > &stdlib_proof, const std::vector< std::vector< stdlib::field_t< Builder > > > &public_inputs, const bool enable_manifest=false)
 Replicate the operations performed on the AVM transcript during proof verification.
 
static stdlib::field_t< Builderpad_and_hash_avm_transcript (const std::shared_ptr< TemplatedTranscript< Builder > > &transcript, const stdlib::Proof< Builder > &stdlib_proof)
 Hash a transcript that has recorded the operations performed during AVM proof verification.
 

Additional Inherited Members

- Public Types inherited from bb::BaseTranscript< Codec_, HashFunction_ >
using Codec = Codec_
 
using HashFunction = HashFunction_
 
using DataType = typename Codec::DataType
 
using Proof = std::vector< DataType >
 
- Public Member Functions inherited from bb::BaseTranscript< Codec_, HashFunction_ >
 BaseTranscript ()
 
 BaseTranscript (const Proof &proof)
 
std::vector< DataTypeexport_proof ()
 Return the proof data starting at proof_start.
 
void load_proof (const std::vector< DataType > &proof)
 Verifier-specific method. The verifier needs to load a proof or its segment before the verification.
 
size_t get_proof_size ()
 
void enable_manifest ()
 
template<typename ChallengeType >
std::vector< ChallengeType > get_challenges (std::span< const std::string > labels)
 After all the prover messages have been sent, finalize the round by hashing all the data and then create the number of requested challenges.
 
template<typename ChallengeType , size_t N>
std::array< ChallengeType, N > get_challenges (const std::array< std::string, N > &labels)
 Wrapper around get_challenges to handle array of challenges.
 
template<typename ChallengeType >
std::vector< ChallengeType > get_dyadic_powers_of_challenge (const std::string &label, size_t num_challenges)
 Get a challenge and compute its dyadic powers [δ, δ², δ⁴, ..., δ^(2^(num_challenges-1))].
 
template<class T >
void add_to_hash_buffer (const std::string &label, const T &element)
 Adds an element to the transcript.
 
template<class T >
void send_to_verifier (const std::string &label, const T &element)
 Adds a prover message to the transcript, only intended to be used by the prover.
 
template<class T >
receive_from_prover (const std::string &label)
 Reads the next element of type T from the transcript, with a predefined label, only used by verifier.
 
template<typename ChallengeType >
ChallengeType get_challenge (const std::string &label)
 
TranscriptManifest get_manifest () const
 
void print ()
 
void test_set_proof_parsing_state (std::ptrdiff_t start, size_t written)
 Test utility: Set proof parsing state for export after deserialization.
 
std::ptrdiff_t test_get_proof_start () const
 Test utility: Get proof_start for validation.
 
Prooftest_get_proof_data ()
 Test utility: Get mutable reference to proof_data.
 
const Prooftest_get_proof_data () const
 
- Static Public Attributes inherited from bb::BaseTranscript< Codec_, HashFunction_ >
static constexpr bool in_circuit = InCircuit<DataType>
 
static constexpr size_t CHALLENGE_BUFFER_SIZE = 2
 
- Protected Member Functions inherited from bb::BaseTranscript< Codec_, HashFunction_ >
void add_element_frs_to_hash_buffer (const std::string &label, std::span< const DataType > element_frs)
 Adds challenge elements to the current_round_buffer and updates the manifest.
 
template<typename T >
void serialize_to_buffer (const T &element, Proof &proof_data)
 Serializes object and appends it to proof_data.
 
template<typename T >
deserialize_from_buffer (const Proof &proof_data, size_t &offset) const
 Deserializes the frs starting at offset into the typed element and returns that element.
 
- Protected Attributes inherited from bb::BaseTranscript< Codec_, HashFunction_ >
Proof proof_data
 

Detailed Description

template<typename Builder>
class bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >

Definition at line 110 of file recursive_flavor.hpp.

Member Typedef Documentation

◆ Base

Definition at line 111 of file recursive_flavor.hpp.

◆ FF

Definition at line 112 of file recursive_flavor.hpp.

Member Function Documentation

◆ hash_avm_transcript() [1/2]

template<typename Builder >
static stdlib::field_t< Builder > bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >::hash_avm_transcript ( Builder builder,
const stdlib::Proof< Builder > &  stdlib_proof,
const std::vector< std::vector< stdlib::field_t< Builder > > > &  public_inputs 
)
inlinestatic

Construct a transcript replicating the operations performed on the AVM transcript during proof verification. Then, hash the transcript to obtain the final state.

Definition at line 266 of file recursive_flavor.hpp.

◆ hash_avm_transcript() [2/2]

template<typename Builder >
static stdlib::field_t< Builder > bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >::hash_avm_transcript ( const std::shared_ptr< TemplatedTranscript< Builder > > &  transcript,
const stdlib::Proof< Builder > &  stdlib_proof 
)
inlinestatic

Hash the AVM verifier transcript after having performed proof verification. Then, hash the transcript to obtain the final state.

Definition at line 280 of file recursive_flavor.hpp.

◆ hash_avm_transcript_for_testing()

template<typename Builder >
static std::pair< stdlib::field_t< Builder >, std::shared_ptr< TemplatedTranscript< Builder > > > bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >::hash_avm_transcript_for_testing ( Builder builder,
const stdlib::Proof< Builder > &  stdlib_proof,
const std::vector< std::vector< stdlib::field_t< Builder > > > &  public_inputs 
)
inlinestatic

Testing method to hash the transcript after having replicated the operations performed on the AVM transcript during proof verification and return both the final state and the transcript.

Definition at line 292 of file recursive_flavor.hpp.

◆ pad_and_hash_avm_transcript()

template<typename Builder >
static stdlib::field_t< Builder > bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >::pad_and_hash_avm_transcript ( const std::shared_ptr< TemplatedTranscript< Builder > > &  transcript,
const stdlib::Proof< Builder > &  stdlib_proof 
)
inlinestaticprivate

Hash a transcript that has recorded the operations performed during AVM proof verification.

Before hashing, if the proof is padded, add to the transcript the padding values.

Definition at line 244 of file recursive_flavor.hpp.

◆ perform_avm_transcript_operations()

template<typename Builder >
static std::shared_ptr< TemplatedTranscript< Builder > > bb::avm2::AvmRecursiveFlavor::TemplatedTranscript< Builder >::perform_avm_transcript_operations ( Builder builder,
const stdlib::Proof< Builder > &  stdlib_proof,
const std::vector< std::vector< stdlib::field_t< Builder > > > &  public_inputs,
const bool  enable_manifest = false 
)
inlinestaticprivate

Replicate the operations performed on the AVM transcript during proof verification.

The transcript used during the verification of an AVM proof hashes both the public inputs and the AVM proof being verified. For this reason, its final state can be used as a hash of the public inputs and proof that have been verified. This method replicates the operations performed on the transcript during AVM verification. It is used by hash_avm_transcript below, which in turn is used in the outer circuit of the Two Layer AVM Recursive verification.

Definition at line 125 of file recursive_flavor.hpp.


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