|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <gate_separator.hpp>
Public Member Functions | |
| GateSeparatorPolynomial (const std::vector< FF > &betas, const size_t log_num_monomials) | |
| Construct a new GateSeparatorPolynomial. | |
| GateSeparatorPolynomial (const std::vector< FF > &betas) | |
| Construct a new GateSeparatorPolynomial object without expanding to a vector of monomials. | |
| GateSeparatorPolynomial (const std::vector< FF > &betas, const std::vector< FF > &challenge) | |
| Constructs a virtual GateSeparator used by the prover in rounds k > d - 1, and computes its partial evaluation at (u_0, ..., u_{d-1}). | |
| FF const & | operator[] (size_t idx) const |
| Retruns the element in beta_products at place #idx. | |
| template<typename Element > | |
| Element | gather (size_t edge_idx) const |
Read Element::SIZE consecutive edge-pair pow_beta factors starting at edge_idx, packed as a single Element value. Lane j reads (*this)[edge_idx + 2j]. | |
| FF | current_element () const |
| Computes the component at index current_element_idx in betas. | |
| FF | univariate_eval (FF challenge) const |
| Evaluate \( ((1−X_{i}) + X_{i}\cdot \beta_{i})\) at the challenge point \( X_{i}=u_{i} \). | |
| void | partially_evaluate (FF challenge) |
| Partially evaluate the \(pow_{\beta} \)-polynomial at the new challenge and update \( c_i \). | |
Static Public Member Functions | |
| static FF | univariate_factor (const FF &challenge, const FF &beta) |
| The pow_β per-variable factor \( (1 - X) + X\cdot \beta \) at \( X = \mathrm{challenge} \). | |
| static BB_PROFILE Polynomial< FF > | compute_beta_products (const std::vector< FF > &betas, const size_t log_num_monomials, const FF &scaling_factor=FF(1)) |
| Given \( \vec\beta = (\beta_0,...,\beta_{d-1})\) compute \( pow_{\ell}(\vec \beta) = pow_{\beta}(\vec
\ell)\) for \( \ell =0,\ldots,2^{d}-1\). | |
Public Attributes | |
| std::vector< FF > | betas |
| The challenges \((\beta_0,\ldots, \beta_{d-1}) \). | |
| Polynomial< FF > | beta_products |
| The consecutive evaluations \( pow_{\ell}(\beta) = pow_{\beta}(\vec \ell) \) for \(\vec \ell\) identified with the integers \(\ell = 0,\ldots, 2^d-1\). | |
| size_t | current_element_idx = 0 |
| In Round \( i\) of Sumcheck, it points to the \( i \)-th element in \( \vec \beta \). | |
| size_t | periodicity = 2 |
| In Round \( i\) of Sumcheck, the periodicity equals to \( 2^{i+1}\) and represents the fixed interval at which elements not containing either of \( (\beta_0,\ldots ,β_i)\) appear in beta_products. | |
| FF | partial_evaluation_result = FF(1) |
| The value \(c_i\) obtained by partially evaluating one variable in the power polynomial at each round. At the end of Round \( i \) in the sumcheck protocol, variable \(X_i\) is replaced by the challenge \(u_i
\). The partial evaluation result is updated to represent \( pow_{\beta}(u_0,.., u_{i}) = \prod_{k=0}^{i} (
(1-u_k) + u_k\cdot \beta_k) \). | |
Definition at line 19 of file gate_separator.hpp.
|
inline |
Construct a new GateSeparatorPolynomial.
| betas | |
| log_num_monomials |
Definition at line 58 of file gate_separator.hpp.
|
inline |
Construct a new GateSeparatorPolynomial object without expanding to a vector of monomials.
The sumcheck verifier does not use beta_products
| betas |
Definition at line 69 of file gate_separator.hpp.
|
inline |
Constructs a virtual GateSeparator used by the prover in rounds k > d - 1, and computes its partial evaluation at (u_0, ..., u_{d-1}).
Definition at line 78 of file gate_separator.hpp.
|
inlinestatic |
Given \( \vec\beta = (\beta_0,...,\beta_{d-1})\) compute \( pow_{\ell}(\vec \beta) = pow_{\beta}(\vec \ell)\) for \( \ell =0,\ldots,2^{d}-1\).
| log_num_monomials | Determines the number of beta challenges used to compute beta_products (required because when we generate CONST_SIZE_PROOF_LOG_N, currently 28, challenges but the real circuit size is less than 1 << CONST_SIZE_PROOF_LOG_N, we should compute unnecessarily a vector of beta_products of length 1 << 28 ) |
Definition at line 163 of file gate_separator.hpp.
|
inline |
Computes the component at index current_element_idx in betas.
Definition at line 119 of file gate_separator.hpp.
|
inline |
Read Element::SIZE consecutive edge-pair pow_beta factors starting at edge_idx, packed as a single Element value. Lane j reads (*this)[edge_idx + 2j].
Uniform stride-2 gather for the scalar (Element = FF) and SIMD (Element = VectorField<...>) sumcheck paths: FF::from_lanes is a width-1 identity so this reduces to (*this)[edge_idx] for scalar; for VectorField it fills all lanes.
Definition at line 110 of file gate_separator.hpp.
|
inline |
Retruns the element in beta_products at place #idx.
| idx |
Definition at line 94 of file gate_separator.hpp.
|
inline |
Partially evaluate the \(pow_{\beta} \)-polynomial at the new challenge and update \( c_i \).
Update the constant \(c_{i} \to c_{i+1} \) multiplying it by \(pow_{\beta}\)'s factor \(\left( (1-X_i) + X_i\cdot \beta_i\right)\vert_{X_i = u_i}\) computed by univariate_eval.
| challenge | \( i \)-th verifier challenge \( u_{i}\) |
Definition at line 145 of file gate_separator.hpp.
|
inline |
Evaluate \( ((1−X_{i}) + X_{i}\cdot \beta_{i})\) at the challenge point \( X_{i}=u_{i} \).
Definition at line 137 of file gate_separator.hpp.
|
inlinestatic |
The pow_β per-variable factor \( (1 - X) + X\cdot \beta \) at \( X = \mathrm{challenge} \).
The building block of every pow_β / eq / shifted-eq fold; shared with ShiftedEqPolynomial so the factor has a single definition.
Definition at line 132 of file gate_separator.hpp.
| Polynomial<FF> bb::GateSeparatorPolynomial< FF >::beta_products |
The consecutive evaluations \( pow_{\ell}(\beta) = pow_{\beta}(\vec \ell) \) for \(\vec \ell\) identified with the integers \(\ell = 0,\ldots, 2^d-1\).
Definition at line 31 of file gate_separator.hpp.
| std::vector<FF> bb::GateSeparatorPolynomial< FF >::betas |
The challenges \((\beta_0,\ldots, \beta_{d-1}) \).
Definition at line 24 of file gate_separator.hpp.
| size_t bb::GateSeparatorPolynomial< FF >::current_element_idx = 0 |
In Round \( i\) of Sumcheck, it points to the \( i \)-th element in \( \vec \beta \).
Definition at line 36 of file gate_separator.hpp.
| FF bb::GateSeparatorPolynomial< FF >::partial_evaluation_result = FF(1) |
The value \(c_i\) obtained by partially evaluating one variable in the power polynomial at each round. At the end of Round \( i \) in the sumcheck protocol, variable \(X_i\) is replaced by the challenge \(u_i \). The partial evaluation result is updated to represent \( pow_{\beta}(u_0,.., u_{i}) = \prod_{k=0}^{i} ( (1-u_k) + u_k\cdot \beta_k) \).
Definition at line 50 of file gate_separator.hpp.
| size_t bb::GateSeparatorPolynomial< FF >::periodicity = 2 |
In Round \( i\) of Sumcheck, the periodicity equals to \( 2^{i+1}\) and represents the fixed interval at which elements not containing either of \( (\beta_0,\ldots ,β_i)\) appear in beta_products.
Definition at line 42 of file gate_separator.hpp.