Skip to main content

mask_buffer_dimensions

Function mask_buffer_dimensions 

Source
pub fn mask_buffer_dimensions(n_vars: usize, degree: usize) -> (usize, usize)
Expand description

Returns (m_n, m_d) dimensions for a mask polynomial buffer.

The ZK MLE-check protocol uses a separable mask polynomial with n_vars univariate polynomials, each of degree d. The mask coefficients are stored in a 2^m_n × 2^m_d matrix where:

  • m_n: log of number of rows (one per variable, padded to power of two)
  • m_d: log of row size (degree + 1 coefficients, padded to power of two)

The protocol imposes n * d + 1 linear constraints on the coefficients, so m_n is chosen such that 2^(m_n + m_d) >= n * d + 1.

§Arguments

  • n_vars - Number of variables (n).
  • degree - Degree of each univariate polynomial (d).

§Returns

A tuple (m_n, m_d) where the total mask buffer size is 2^(m_n + m_d).