Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ultra_rollup_recursive_flavor.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
22
23namespace bb {
24
39template <typename BuilderType> class UltraRollupRecursiveFlavor_ : public UltraRecursiveFlavor_<BuilderType> {
40 public:
41 using CircuitBuilder = BuilderType; // Determines arithmetization of circuit instantiated with this flavor
44 using PCS = KZG<Curve>;
45 using GroupElement = typename Curve::Element;
46 using Commitment = typename Curve::Element;
47 using FF = typename Curve::ScalarField;
51
61 : public StdlibVerificationKey_<BuilderType, UltraRollupFlavor::PrecomputedEntities<Commitment>> {
62 public:
64
72 {
73 this->log_circuit_size = FF::from_witness(builder, native_key->log_circuit_size);
74 this->num_public_inputs = FF::from_witness(builder, native_key->num_public_inputs);
75 this->pub_inputs_offset = FF::from_witness(builder, native_key->pub_inputs_offset);
76
77 // Generate stdlib commitments (biggroup) from the native counterparts
78 for (auto [commitment, native_commitment] : zip_view(this->get_all(), native_key->get_all())) {
79 commitment = Commitment::from_witness(builder, native_commitment);
80 }
81 };
82
90 {
91 using namespace bb::stdlib::field_conversion;
92
93 size_t num_frs_read = 0;
94
95 this->log_circuit_size = deserialize_from_frs<FF>(builder, elements, num_frs_read);
96 this->num_public_inputs = deserialize_from_frs<FF>(builder, elements, num_frs_read);
97 this->pub_inputs_offset = deserialize_from_frs<FF>(builder, elements, num_frs_read);
98
99 for (Commitment& commitment : this->get_all()) {
100 commitment = deserialize_from_frs<Commitment>(builder, elements, num_frs_read);
101 }
102 }
103
112 const std::span<const uint32_t> witness_indices)
113 {
114 std::vector<FF> vk_fields;
115 vk_fields.reserve(witness_indices.size());
116 for (const auto& idx : witness_indices) {
117 vk_fields.emplace_back(FF::from_witness_index(&builder, idx));
118 }
119 return VerificationKey(builder, vk_fields);
120 }
121 };
122
123 // Reuse the VerifierCommitments from Ultra
126};
127
128} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
Base Stdlib verification key class.
Definition flavor.hpp:242
A container encapsulating all the commitments that the verifier receives (to precomputed polynomials ...
The recursive counterpart to the "native" Ultra flavor.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
VerificationKey(CircuitBuilder *builder, const std::shared_ptr< NativeVerificationKey > &native_key)
Construct a new Verification Key with stdlib types from a provided native verification key.
static VerificationKey from_witness_indices(CircuitBuilder &builder, const std::span< const uint32_t > witness_indices)
Construct a VerificationKey from a set of corresponding witness indices.
VerificationKey(CircuitBuilder &builder, std::span< FF > elements)
Deserialize a verification key from a vector of field elements.
The recursive counterpart to the "native" UltraRollupFlavor.
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
static field_t from_witness_index(Builder *ctx, uint32_t witness_index)
Definition field.cpp:59
static field_t from_witness(Builder *ctx, const bb::fr &input)
Definition field.hpp:424
AluTraceBuilder builder
Definition alu.test.cpp:123
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
field_t< CircuitBuilder > ScalarField
Definition bn254.hpp:33