Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
row_disabling_polynomial.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
12
13#include <cstddef>
14#include <vector>
15namespace bb {
141template <typename FF> struct RowDisablingPolynomial {
142 // initialized as a constant linear polynomial = 1
145
157 void update_evaluations(FF round_challenge, size_t round_idx)
158 {
159 if (round_idx == 1) {
160 eval_at_0 = FF{ 0 };
161 }
162 if (round_idx >= 2) {
163 eval_at_1 *= round_challenge;
164 }
165 }
173 static FF evaluate_at_challenge(std::vector<FF> multivariate_challenge, const size_t log_circuit_size)
174 {
175 FF evaluation_at_multivariate_challenge{ 1 };
176
177 for (size_t idx = 2; idx < log_circuit_size; idx++) {
178 evaluation_at_multivariate_challenge *= multivariate_challenge[idx];
179 }
180
181 return FF{ 1 } - evaluation_at_multivariate_challenge;
182 }
183
190 static FF evaluate_at_challenge(std::span<FF> multivariate_challenge,
191 const std::vector<FF>& padding_indicator_array)
192 {
193 FF evaluation_at_multivariate_challenge{ 1 };
194
195 for (size_t idx = 2; idx < padding_indicator_array.size(); idx++) {
196 const FF& indicator = padding_indicator_array[idx];
197 evaluation_at_multivariate_challenge *= FF{ 1 } - indicator + indicator * multivariate_challenge[idx];
198 }
199
200 return FF{ 1 } - evaluation_at_multivariate_challenge;
201 }
202};
203
204} // namespace bb
Entry point for Barretenberg command-line interface.
typename Flavor::FF FF
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Polynomial for Sumcheck with disabled Rows.
static FF evaluate_at_challenge(std::vector< FF > multivariate_challenge, const size_t log_circuit_size)
Compute the evaluation of at the sumcheck challenge.
void update_evaluations(FF round_challenge, size_t round_idx)
Compute the evaluations of L^{(i)} at 0 and 1.
static FF evaluate_at_challenge(std::span< FF > multivariate_challenge, const std::vector< FF > &padding_indicator_array)
A variant of the above that uses padding_indicator_array.