|
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 |
| 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 |
| 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. | |
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 161 of file flavor.hpp.
| using bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::Commitment = typename PrecomputedCommitments::DataType |
Definition at line 163 of file flavor.hpp.
|
virtualdefault |
|
default |
|
inline |
Definition at line 171 of file flavor.hpp.
|
inlinestatic |
Calculate the number of field elements needed for serialization.
Definition at line 181 of file flavor.hpp.
|
inline |
Populate verification key from field elements.
| elements | Field elements to deserialize from |
Definition at line 230 of file flavor.hpp.
|
inline |
A model function to show how to compute the VK hash(without the Transcript abstracting things away)
Currently only used in testing.
Definition at line 258 of file flavor.hpp.
|
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.
| domain_separator | |
| transcript |
Reimplemented in bb::ECCVMFlavor::VerificationKey, and bb::TranslatorFlavor::VerificationKey.
Definition at line 277 of file flavor.hpp.
|
default |
|
inlinevirtual |
Serialize verification key to field elements.
Definition at line 200 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::log_circuit_size = 0 |
Definition at line 164 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::num_public_inputs = 0 |
Definition at line 165 of file flavor.hpp.
| uint64_t bb::NativeVerificationKey_< PrecomputedCommitments, Transcript, SerializeMetadata >::pub_inputs_offset = 0 |
Definition at line 166 of file flavor.hpp.