|
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 |
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 | |
| NativeVerificationKey_ (const size_t circuit_size, const size_t num_public_inputs) | |
| virtual std::vector< typename Transcript::DataType > | to_field_elements () const |
| Serialize verification key to field elements. | |
| size_t | from_field_elements (const std::span< const typename Transcript::DataType > &elements) |
| Populate verification key from field elements. | |
| fr | hash () const |
| Compute VK hash. | |
| virtual Transcript::DataType | hash_with_origin_tagging (const std::string &domain_separator, Transcript &transcript) const |
| Tag VK components and hash. | |
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. |
Definition at line 137 of file flavor.hpp.
| using bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::Commitment = typename PrecomputedCommitments::DataType |
Definition at line 139 of file flavor.hpp.
|
virtualdefault |
|
default |
|
inline |
Definition at line 179 of file flavor.hpp.
|
inlinestatic |
Calculate the number of field elements needed for serialization.
Definition at line 189 of file flavor.hpp.
|
inline |
Definition at line 147 of file flavor.hpp.
|
inline |
Populate verification key from field elements.
| elements | Field elements to deserialize from |
Definition at line 238 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.
| domain_separator | (currently unused, kept for API compatibility) |
| transcript | Used to extract tag context (transcript_index, round_index) |
Reimplemented in bb::ECCVMFlavor::VerificationKey, and bb::TranslatorFlavor::VerificationKey.
Definition at line 281 of file flavor.hpp.
|
default |
|
inlinevirtual |
Serialize verification key to field elements.
Definition at line 208 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::log_circuit_size = 0 |
Definition at line 140 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::num_public_inputs = 0 |
Definition at line 141 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::pub_inputs_offset = 0 |
Definition at line 142 of file flavor.hpp.