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: Complete, auditors: [Khashayar], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
13
14#include <cstddef>
15#include <vector>
16namespace bb {
123template <typename FF> struct RowDisablingPolynomial {
124 // initialized as a constant linear polynomial = 1
127
139 void update_evaluations(FF round_challenge, size_t round_idx)
140 {
141 if (round_idx == 1) {
142 eval_at_1 = FF{ 0 };
143 }
144 if (round_idx >= 2) {
145 eval_at_0 *= (FF{ 1 } - round_challenge);
146 }
147 }
155 static FF evaluate_at_challenge(std::span<const FF> multivariate_challenge, const size_t log_circuit_size)
156 {
157 BB_ASSERT(multivariate_challenge.size() >= log_circuit_size,
158 "RowDisablingPolynomial: challenge shorter than log_circuit_size");
159 FF evaluation_at_multivariate_challenge{ 1 };
160
161 for (size_t idx = 2; idx < log_circuit_size; idx++) {
162 evaluation_at_multivariate_challenge *= (FF{ 1 } - multivariate_challenge[idx]);
163 }
164
165 return FF{ 1 } - evaluation_at_multivariate_challenge;
166 }
167};
168
169} // namespace bb
#define BB_ASSERT(expression,...)
Definition assert.hpp:70
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
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::span< const 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.