107 ranges.emplace_back(start, end);
108 for (
size_t i = start; i < end; ++i) {
151template <
typename PrecomputedCommitments,
typename Transcript>
154 using Commitment =
typename PrecomputedCommitments::DataType;
179 buffer.insert(
buffer.end(), input_fields.begin(), input_fields.end());
184 serialize(this->log_circuit_size, elements);
185 serialize(this->num_public_inputs, elements);
186 serialize(this->pub_inputs_offset, elements);
188 for (
const Commitment& commitment : this->get_all()) {
226 for (
const Commitment& commitment : this->get_all()) {
241template <
typename Builder_,
typename PrecomputedCommitments>
246 using Commitment =
typename PrecomputedCommitments::DataType;
270 auto serialize_to_field_buffer = []<
typename T>(
const T& input, std::vector<FF>&
buffer) {
271 std::vector<FF> input_fields = convert_to_bn254_frs<Builder, T>(input);
272 buffer.insert(
buffer.end(), input_fields.begin(), input_fields.end());
275 std::vector<FF> elements;
277 serialize_to_field_buffer(this->log_circuit_size, elements);
278 serialize_to_field_buffer(this->num_public_inputs, elements);
279 serialize_to_field_buffer(this->pub_inputs_offset, elements);
281 for (
const Commitment& commitment : this->get_all()) {
282 serialize_to_field_buffer(commitment, elements);
317 for (
const Commitment& commitment : this->get_all()) {
324template <
typename FF,
typename VerificationKey>
class VKAndHash_ {
344 std::shared_ptr<VerificationKey>
vk;
351 return concatenate(all_entities.get_unshifted(), all_entities.get_shifted());
363 return std::max({ std::tuple_element_t<Is, Tuple>::RELATION_LENGTH... });
376 return std::max({ std::tuple_element_t<Is, Tuple>::TOTAL_RELATION_LENGTH... });
387 return (0 + ... + std::tuple_element_t<I, Tuple>::SUBRELATION_PARTIAL_LENGTHS.size());
399template <
typename Tuple,
size_t NUM_KEYS,
bool optimized = false>
404 if constexpr (optimized) {
406 typename std::tuple_element_t<I, Tuple>::template ProtogalaxyTupleOfUnivariatesOverSubrelations<
411 template ProtogalaxyTupleOfUnivariatesOverSubrelationsNoOptimisticSkipping<NUM_KEYS>{}...);
427 typename std::tuple_element_t<I, RelationsTuple>::SumcheckTupleOfUnivariatesOverSubrelations{}...);
441 typename std::tuple_element_t<I, RelationsTuple>::SumcheckArrayOfValuesOverSubrelations{}...);
454#ifdef STARKNET_GARAGA_FLAVORS
455class UltraStarknetFlavor;
456class UltraStarknetZKFlavor;
464class AvmRecursiveFlavor;
#define BB_ASSERT_GTE(left, right,...)
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
DataType hash_independent_buffer()
Hashes the independent hash buffer and clears it.
void add_to_independent_hash_buffer(const std::string &label, const T &element)
Adds an element to an independent hash buffer.
static std::vector< DataType > serialize(const T &element)
Serialize a size_t to a vector of field elements.
TranscriptParams::DataType DataType
static DataType hash(const std::vector< DataType > &data)
Static hash method that forwards to TranscriptParams hash.
The recursive counterpart to the "native" Mega flavor.
Child class of MegaFlavor that runs with ZK Sumcheck. See more in Sumcheck Outline.
The recursive counterpart to the "native" MegaZKFlavor.
Base Native verification key class.
uint64_t log_circuit_size
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.
NativeVerificationKey_(const size_t circuit_size, const size_t num_public_inputs)
uint64_t pub_inputs_offset
uint64_t num_public_inputs
fr hash() const
A model function to show how to compute the VK hash(without the Transcript abstracting things away)
virtual std::vector< typename Transcript::DataType > to_field_elements() const
Serialize verification key to field elements.
typename PrecomputedCommitments::DataType Commitment
bool operator==(const NativeVerificationKey_ &) const =default
NativeVerificationKey_()=default
virtual ~NativeVerificationKey_()=default
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
Base Stdlib verification key class.
virtual FF hash_through_transcript(const std::string &domain_separator, Transcript &transcript) const
Hashes the vk using the transcript's independent buffer and returns the hash.
bool operator==(const StdlibVerificationKey_ &) const =default
virtual std::vector< FF > to_field_elements() const
Serialize verification key to field elements.
FF hash(Builder &builder)
A model function to show how to compute the VK hash (without the Transcript abstracting things away).
StdlibVerificationKey_()=default
typename PrecomputedCommitments::DataType Commitment
virtual ~StdlibVerificationKey_()=default
StdlibVerificationKey_(const size_t circuit_size, const size_t num_public_inputs)
The recursive counterpart of the native Translator flavor.
The recursive counterpart to the "native" Ultra flavor.
The recursive counterpart to the "native" UltraRollupFlavor.
Child class of UltraFlavor that runs with ZK Sumcheck.
The recursive counterpart to the Ultra flavor with ZK.
VerificationKey::NativeVerificationKey NativeVerificationKey
VKAndHash_(Builder &builder, const std::shared_ptr< NativeVerificationKey > &native_vk)
std::shared_ptr< VerificationKey > vk
VKAndHash_(const std::shared_ptr< VerificationKey > &vk, const FF &hash)
VerificationKey::Builder Builder
VKAndHash_(const std::shared_ptr< VerificationKey > &vk)
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
constexpr size_t NUM_KEYS
uint8_t buffer[RANDOM_BUFFER_SIZE]
UltraKeccakFlavor::VerificationKey VerificationKey
constexpr T get_msb(const T in)
Entry point for Barretenberg command-line interface.
constexpr auto create_protogalaxy_tuple_of_tuples_of_univariates()
Utility function to construct a container for the subrelation accumulators of Protogalaxy folding.
RefArray< T,(Ns+...)> constexpr concatenate(const RefArray< T, Ns > &... ref_arrays)
Concatenates multiple RefArray objects into a single RefArray.
constexpr size_t compute_number_of_subrelations()
Utility function to find the number of subrelations.
constexpr auto create_tuple_of_arrays_of_values()
Construct tuple of arrays.
constexpr size_t compute_max_partial_relation_length()
Utility function to find max PARTIAL_RELATION_LENGTH tuples of Relations.
constexpr size_t compute_max_total_relation_length()
Utility function to find max TOTAL_RELATION_LENGTH among tuples of Relations.
constexpr auto create_sumcheck_tuple_of_tuples_of_univariates()
Utility function to construct a container for the subrelation accumulators of sumcheck proving.
auto get_unshifted_then_shifted(const auto &all_entities)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
TUPLET_INLINE constexpr auto make_tuple(Ts &&... args)
std::pair< size_t, size_t > get_range(const size_t idx) const
size_t get_idx(const size_t idx) const
std::vector< std::pair< size_t, size_t > > ranges
size_t num_ranges() const
void add_range(const size_t start, const size_t end)
std::vector< size_t > idxs
std::vector< std::pair< size_t, size_t > > get_ranges() const
The precomputed data needed to compute a Honk VK.
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials