Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::NativeVerificationKey_< PrecomputedCommitments, Transcript > Class Template Reference

Base Native verification key class. More...

#include <flavor.hpp>

Inheritance diagram for bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >:

Public Types

using Commitment = typename PrecomputedCommitments::DataType
 

Public Member Functions

bool operator== (const NativeVerificationKey_ &) const =default
 
virtual ~NativeVerificationKey_ ()=default
 
 NativeVerificationKey_ ()=default
 
 NativeVerificationKey_ (const size_t circuit_size, const size_t num_public_inputs)
 
virtual std::vector< typename Transcript::DataTypeto_field_elements () const
 Serialize verification key to field elements.
 
fr hash () const
 A model function to show how to compute the VK hash(without the Transcript abstracting things away)
 
virtual Transcript::DataType hash_through_transcript (const std::string &domain_separator, Transcript &transcript) const
 Hashes the vk using the transcript's independent buffer and returns the hash.
 

Public Attributes

uint64_t log_circuit_size = 0
 
uint64_t num_public_inputs = 0
 
uint64_t pub_inputs_offset = 0
 

Detailed Description

template<typename PrecomputedCommitments, typename Transcript>
class bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >

Base Native verification key class.

We want a separate native and stdlib verification key class because we don't have nice mappings from native to stdlib and back. Examples of mappings that don't exist are from uint64_t to field_t, .get_value() doesn't have a native equivalent, and Builder also doesn't have a native equivalent.

Template Parameters
PrecomputedEntitiesAn instance of PrecomputedEntities_ with affine_element data type and handle type.

Definition at line 152 of file flavor.hpp.

Member Typedef Documentation

◆ Commitment

template<typename PrecomputedCommitments , typename Transcript >
using bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::Commitment = typename PrecomputedCommitments::DataType

Definition at line 154 of file flavor.hpp.

Constructor & Destructor Documentation

◆ ~NativeVerificationKey_()

template<typename PrecomputedCommitments , typename Transcript >
virtual bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::~NativeVerificationKey_ ( )
virtualdefault

◆ NativeVerificationKey_() [1/2]

template<typename PrecomputedCommitments , typename Transcript >
bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::NativeVerificationKey_ ( )
default

◆ NativeVerificationKey_() [2/2]

template<typename PrecomputedCommitments , typename Transcript >
bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::NativeVerificationKey_ ( const size_t  circuit_size,
const size_t  num_public_inputs 
)
inline

Definition at line 162 of file flavor.hpp.

Member Function Documentation

◆ hash()

template<typename PrecomputedCommitments , typename Transcript >
fr bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::hash ( ) const
inline

A model function to show how to compute the VK hash(without the Transcript abstracting things away)

Currently only used in testing.

Returns
FF

Definition at line 200 of file flavor.hpp.

◆ hash_through_transcript()

template<typename PrecomputedCommitments , typename Transcript >
virtual Transcript::DataType bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::hash_through_transcript ( const std::string &  domain_separator,
Transcript transcript 
) const
inlinevirtual

Hashes the vk using the transcript's independent buffer and returns the hash.

Needed to make sure the Origin Tag system works. We need to set the origin tags of the VK witnesses in the transcript. If we instead did the hashing outside of the transcript and submitted just the hash, only the origin tag of the hash would be set properly. We want to avoid backpropagating origin tags to the actual VK witnesses because it would be manual, as backpropagation of tags is not generally correct. By doing it like this, the origin tags of the VK all get set, so our tooling won't complain when we use the VK later on in the protocol.

Parameters
domain_separator
transcript
Returns
The hash of the verification key

Reimplemented in bb::ECCVMFlavor::VerificationKey, and bb::TranslatorFlavor::VerificationKey.

Definition at line 219 of file flavor.hpp.

◆ operator==()

template<typename PrecomputedCommitments , typename Transcript >
bool bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::operator== ( const NativeVerificationKey_< PrecomputedCommitments, Transcript > &  ) const
default

◆ to_field_elements()

template<typename PrecomputedCommitments , typename Transcript >
virtual std::vector< typename Transcript::DataType > bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::to_field_elements ( ) const
inlinevirtual

Serialize verification key to field elements.

Returns
std::vector<FF>

Reimplemented in bb::ECCVMFlavor::VerificationKey, bb::TranslatorFlavor::VerificationKey, and bb::avm2::AvmFlavor::VerificationKey.

Definition at line 173 of file flavor.hpp.

Member Data Documentation

◆ log_circuit_size

template<typename PrecomputedCommitments , typename Transcript >
uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::log_circuit_size = 0

Definition at line 155 of file flavor.hpp.

◆ num_public_inputs

template<typename PrecomputedCommitments , typename Transcript >
uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::num_public_inputs = 0

Definition at line 156 of file flavor.hpp.

◆ pub_inputs_offset

template<typename PrecomputedCommitments , typename Transcript >
uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript >::pub_inputs_offset = 0

Definition at line 157 of file flavor.hpp.


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