|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Base Native verification key class. More...
#include <flavor.hpp>
Public Types | |
| using | Commitment = typename PrecomputedCommitments::DataType |
| using | DataType = typename Codec::DataType |
Public Member Functions | |
| bool | operator== (const NativeVerificationKey_ &) const =default |
| template<size_t NUM_PRECOMPUTED_ENTITIES, typename StringType > | |
| bool | compare (const NativeVerificationKey_ &other, RefArray< StringType, NUM_PRECOMPUTED_ENTITIES > commitment_labels) const |
| virtual | ~NativeVerificationKey_ ()=default |
| NativeVerificationKey_ ()=default | |
| template<typename PrecomputedData > requires (!std::is_void_v<CommitmentKey>) | |
| NativeVerificationKey_ (const PrecomputedData &precomputed) | |
| Construct VK from precomputed data by committing to polynomials. | |
| virtual std::vector< DataType > | to_field_elements () const |
| Serialize verification key to field elements. | |
| size_t | from_field_elements (const std::span< const DataType > &elements) |
| Populate verification key from field elements. | |
| fr | hash () const |
| Compute VK hash. | |
| virtual DataType | hash_with_origin_tagging (const OriginTag &tag) const |
| Tag VK components and hash. | |
| template<typename Transcript > | |
| DataType | hash_with_origin_tagging (const Transcript &transcript) const |
| An overload that accepts a transcript and extracts the tag internally. | |
Static Public Member Functions | |
| static size_t | calc_num_data_types () |
| Calculate the number of field elements needed for serialization. | |
Public Attributes | |
| uint64_t | log_circuit_size = 0 |
| uint64_t | num_public_inputs = 0 |
| uint64_t | pub_inputs_offset = 0 |
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.
| PrecomputedEntities | An instance of PrecomputedEntities_ with affine_element data type and handle type. |
| Codec | The codec used for serialization (e.g., FrCodec, U256Codec) |
| HashFunction | The hash function used for VK hashing (e.g., Poseidon2, Keccak) |
Definition at line 135 of file flavor.hpp.
| using bb::NativeVerificationKey_< PrecomputedCommitments, Codec, HashFunction, CommitmentKey >::Commitment = typename PrecomputedCommitments::DataType |
Definition at line 137 of file flavor.hpp.
| using bb::NativeVerificationKey_< PrecomputedCommitments, Codec, HashFunction, CommitmentKey >::DataType = typename Codec::DataType |
Definition at line 138 of file flavor.hpp.
|
virtualdefault |
|
default |
|
inlineexplicit |
Construct VK from precomputed data by committing to polynomials.
Only available when CommitmentKeyType is specified (not void)
Definition at line 185 of file flavor.hpp.
|
inlinestatic |
Calculate the number of field elements needed for serialization.
Definition at line 200 of file flavor.hpp.
|
inline |
Definition at line 146 of file flavor.hpp.
|
inline |
Populate verification key from field elements.
| elements | Field elements to deserialize from |
Definition at line 237 of file flavor.hpp.
|
inline |
|
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.
| tag | The origin tag extracted from the transcript |
Definition at line 276 of file flavor.hpp.
|
inline |
An overload that accepts a transcript and extracts the tag internally.
| TranscriptType | The transcript type (Codec and HashFunction deduced automatically) |
| transcript | The transcript to extract the origin tag from |
Definition at line 311 of file flavor.hpp.
|
default |
|
inlinevirtual |
Serialize verification key to field elements.
Definition at line 212 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Codec, HashFunction, CommitmentKey >::log_circuit_size = 0 |
Definition at line 139 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Codec, HashFunction, CommitmentKey >::num_public_inputs = 0 |
Definition at line 140 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Codec, HashFunction, CommitmentKey >::pub_inputs_offset = 0 |
Definition at line 141 of file flavor.hpp.