Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::GateSeparatorPolynomial< FF > Struct Template Reference

#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< FFcompute_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< FFbetas
 The challenges \((\beta_0,\ldots, \beta_{d-1}) \).
 
Polynomial< FFbeta_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) \).
 

Detailed Description

template<typename FF>
struct bb::GateSeparatorPolynomial< FF >

Definition at line 19 of file gate_separator.hpp.

Constructor & Destructor Documentation

◆ GateSeparatorPolynomial() [1/3]

template<typename FF >
bb::GateSeparatorPolynomial< FF >::GateSeparatorPolynomial ( const std::vector< FF > &  betas,
const size_t  log_num_monomials 
)
inline

Construct a new GateSeparatorPolynomial.

Parameters
betas
log_num_monomials

Definition at line 58 of file gate_separator.hpp.

◆ GateSeparatorPolynomial() [2/3]

template<typename FF >
bb::GateSeparatorPolynomial< FF >::GateSeparatorPolynomial ( const std::vector< FF > &  betas)
inline

Construct a new GateSeparatorPolynomial object without expanding to a vector of monomials.

The sumcheck verifier does not use beta_products

Parameters
betas

Definition at line 69 of file gate_separator.hpp.

◆ GateSeparatorPolynomial() [3/3]

template<typename FF >
bb::GateSeparatorPolynomial< FF >::GateSeparatorPolynomial ( const std::vector< FF > &  betas,
const std::vector< FF > &  challenge 
)
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.

Member Function Documentation

◆ compute_beta_products()

template<typename FF >
static BB_PROFILE Polynomial< FF > bb::GateSeparatorPolynomial< FF >::compute_beta_products ( const std::vector< FF > &  betas,
const size_t  log_num_monomials,
const FF scaling_factor = FF(1) 
)
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\).

Parameters
log_num_monomialsDetermines 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.

◆ current_element()

template<typename FF >
FF bb::GateSeparatorPolynomial< FF >::current_element ( ) const
inline

Computes the component at index current_element_idx in betas.

Returns
FF

Definition at line 119 of file gate_separator.hpp.

◆ gather()

template<typename FF >
template<typename Element >
Element bb::GateSeparatorPolynomial< FF >::gather ( size_t  edge_idx) const
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.

◆ operator[]()

template<typename FF >
FF const & bb::GateSeparatorPolynomial< FF >::operator[] ( size_t  idx) const
inline

Retruns the element in beta_products at place #idx.

Parameters
idx
Returns
FF const&

Definition at line 94 of file gate_separator.hpp.

◆ partially_evaluate()

template<typename FF >
void bb::GateSeparatorPolynomial< FF >::partially_evaluate ( FF  challenge)
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.

Parameters
challenge\( i \)-th verifier challenge \( u_{i}\)

Definition at line 145 of file gate_separator.hpp.

◆ univariate_eval()

template<typename FF >
FF bb::GateSeparatorPolynomial< FF >::univariate_eval ( FF  challenge) const
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.

◆ univariate_factor()

template<typename FF >
static FF bb::GateSeparatorPolynomial< FF >::univariate_factor ( const FF challenge,
const FF beta 
)
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.

Member Data Documentation

◆ beta_products

template<typename FF >
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.

◆ betas

template<typename FF >
std::vector<FF> bb::GateSeparatorPolynomial< FF >::betas

The challenges \((\beta_0,\ldots, \beta_{d-1}) \).

Definition at line 24 of file gate_separator.hpp.

◆ current_element_idx

template<typename FF >
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.

◆ partial_evaluation_result

template<typename FF >
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.

◆ periodicity

template<typename FF >
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.


The documentation for this struct was generated from the following file: