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

Base Stdlib verification key class. More...

#include <flavor.hpp>

Inheritance diagram for bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >:

Public Types

using Builder = Builder_
 
using FF = stdlib::field_t< Builder >
 
using Commitment = typename PrecomputedCommitments::DataType
 
using Transcript = StdlibTranscript< Builder >
 
using NativeVerificationKey = NativeVerificationKey_
 

Public Member Functions

bool operator== (const StdlibVerificationKey_ &) const =default
 
virtual ~StdlibVerificationKey_ ()=default
 
 StdlibVerificationKey_ ()=default
 
template<typename T = NativeVerificationKey_>
requires (!std::is_void_v<T>)
 StdlibVerificationKey_ (Builder *builder, const std::shared_ptr< T > &native_key)
 Construct a new Verification Key with stdlib types from a provided native verification key.
 
 StdlibVerificationKey_ (std::span< FF > elements)
 Deserialize a verification key from a vector of field elements.
 
void fix_witness ()
 Fixes witnesses of VK to be constants.
 
template<typename T = NativeVerificationKey_>
requires (!std::is_void_v<T>)
get_value () const
 Get the native verification key corresponding to this stdlib verification key.
 
virtual FF hash_with_origin_tagging (const OriginTag &tag) const
 Tag VK components and hash.
 
template<typename Transcript >
FF hash_with_origin_tagging (const Transcript &transcript) const
 An overload that accepts a transcript and extracts the tag internally.
 

Static Public Member Functions

static StdlibVerificationKey_ from_witness_indices (Builder &builder, const std::span< const uint32_t > &witness_indices)
 Construct a VerificationKey from a set of corresponding witness indices.
 

Public Attributes

FF log_circuit_size
 
FF num_public_inputs
 
FF pub_inputs_offset = 0
 

Detailed Description

template<typename Builder_, typename PrecomputedCommitments, typename NativeVerificationKey_ = void>
class bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >

Base Stdlib verification key class.

Template Parameters
Builder_The circuit builder type
PrecomputedCommitmentsThe precomputed entities type
NativeVerificationKey_The native VK type (optional, enables native<->stdlib conversion)

Definition at line 371 of file flavor.hpp.

Member Typedef Documentation

◆ Builder

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
using bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::Builder = Builder_

Definition at line 373 of file flavor.hpp.

◆ Commitment

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
using bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::Commitment = typename PrecomputedCommitments::DataType

Definition at line 375 of file flavor.hpp.

◆ FF

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
using bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::FF = stdlib::field_t<Builder>

Definition at line 374 of file flavor.hpp.

◆ NativeVerificationKey

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
using bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::NativeVerificationKey = NativeVerificationKey_

Definition at line 377 of file flavor.hpp.

◆ Transcript

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
using bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::Transcript = StdlibTranscript<Builder>

Definition at line 376 of file flavor.hpp.

Constructor & Destructor Documentation

◆ ~StdlibVerificationKey_()

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
virtual bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::~StdlibVerificationKey_ ( )
virtualdefault

◆ StdlibVerificationKey_() [1/3]

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::StdlibVerificationKey_ ( )
default

◆ StdlibVerificationKey_() [2/3]

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
template<typename T = NativeVerificationKey_>
requires (!std::is_void_v<T>)
bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::StdlibVerificationKey_ ( Builder builder,
const std::shared_ptr< T > &  native_key 
)
inline

Construct a new Verification Key with stdlib types from a provided native verification key.

Only available when NativeVerificationKey is specified (not void)

Definition at line 392 of file flavor.hpp.

◆ StdlibVerificationKey_() [3/3]

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::StdlibVerificationKey_ ( std::span< FF elements)
inlineexplicit

Deserialize a verification key from a vector of field elements.

Definition at line 406 of file flavor.hpp.

Member Function Documentation

◆ fix_witness()

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
void bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::fix_witness ( )
inline

Fixes witnesses of VK to be constants.

Definition at line 438 of file flavor.hpp.

◆ from_witness_indices()

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
static StdlibVerificationKey_ bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::from_witness_indices ( Builder builder,
const std::span< const uint32_t > &  witness_indices 
)
inlinestatic

Construct a VerificationKey from a set of corresponding witness indices.

Definition at line 424 of file flavor.hpp.

◆ get_value()

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
template<typename T = NativeVerificationKey_>
requires (!std::is_void_v<T>)
T bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::get_value ( ) const
inline

Get the native verification key corresponding to this stdlib verification key.

Only available when NativeVerificationKey is specified (not void)

Definition at line 455 of file flavor.hpp.

◆ hash_with_origin_tagging() [1/2]

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
virtual FF bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::hash_with_origin_tagging ( const OriginTag tag) const
inlinevirtual

Tag VK components and hash.

Needed to make sure the Origin Tag system works. We need to set the origin tags of the VK witnesses. If we instead did the hashing outside and just submitted the hash, only the origin tag of the hash would be set properly. By tagging the VK components directly, we ensure all VK witnesses have proper origin tags.

Parameters
tagThe origin tag extracted from the transcript
Returns
The hash of the verification key

Definition at line 477 of file flavor.hpp.

◆ hash_with_origin_tagging() [2/2]

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
template<typename Transcript >
FF bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::hash_with_origin_tagging ( const Transcript transcript) const
inline

An overload that accepts a transcript and extracts the tag internally.

Template Parameters
TranscriptTypeThe transcript type (Codec and HashFunction deduced automatically)
Parameters
transcriptThe transcript to extract the origin tag from
Returns
The hash of the verification key

Definition at line 513 of file flavor.hpp.

◆ operator==()

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

Member Data Documentation

◆ log_circuit_size

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
FF bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::log_circuit_size

Definition at line 378 of file flavor.hpp.

◆ num_public_inputs

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
FF bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::num_public_inputs

Definition at line 379 of file flavor.hpp.

◆ pub_inputs_offset

template<typename Builder_ , typename PrecomputedCommitments , typename NativeVerificationKey_ = void>
FF bb::StdlibVerificationKey_< Builder_, PrecomputedCommitments, NativeVerificationKey_ >::pub_inputs_offset = 0

Definition at line 380 of file flavor.hpp.


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