Skip to main content

Module permutation

Module permutation 

Source
Expand description

This module implements permutation constraint polynomials.

Re-exportsยง

use alloc::vec::Vec; ๐Ÿ”’
use crate::circuits::constraints::ConstraintSystem; ๐Ÿ”’
use crate::circuits::wires::PERMUTS; ๐Ÿ”’
use crate::proof::PointEvaluations; ๐Ÿ”’
use crate::proof::ProofEvaluations; ๐Ÿ”’
use ark_ff::FftField; ๐Ÿ”’
use ark_ff::PrimeField; ๐Ÿ”’
use ark_poly::univariate::DensePolynomial; ๐Ÿ”’
use ark_poly::DenseUVPolynomial; ๐Ÿ”’
use ark_poly::EvaluationDomain; ๐Ÿ”’
use ark_poly::Radix2EvaluationDomain as D; ๐Ÿ”’
use blake2::Blake2b512; ๐Ÿ”’
use blake2::Digest; ๐Ÿ”’
use core::array; ๐Ÿ”’
use crate::circuits::polynomial::WitnessOverDomains; ๐Ÿ”’
use crate::circuits::wires::Wire; ๐Ÿ”’
use crate::circuits::wires::COLUMNS; ๐Ÿ”’
use crate::curve::KimchiCurve; ๐Ÿ”’
use crate::error::ProverError; ๐Ÿ”’
use crate::prover_index::ProverIndex; ๐Ÿ”’
use ark_ff::Zero; ๐Ÿ”’
use ark_poly::univariate::DenseOrSparsePolynomial; ๐Ÿ”’
use ark_poly::Evaluations; ๐Ÿ”’
use ark_poly::Polynomial; ๐Ÿ”’
use o1_utils::ExtendedDensePolynomial; ๐Ÿ”’
use o1_utils::ExtendedEvaluations; ๐Ÿ”’
use rand::CryptoRng; ๐Ÿ”’
use rand::RngCore; ๐Ÿ”’
use rayon::prelude::*; ๐Ÿ”’

Structsยง

Shifts
Shifts represent the shifts required in the permutation argument of PLONK. It also caches the shifted powers of omega for optimization purposes.

Constantsยง

CONSTRAINTS
Number of constraints produced by the argument.

Functionsยง

eval_permutation_vanishing_polynomial
Evaluates the polynomial (x - w^{n - zk_rows}) * (x - w^{n - zk_rows + 1}) * (x - w^{n - 1})
eval_vanishes_on_last_n_rows
Evaluates the polynomial (x - w^{n - i}) * (x - w^{n - i + 1}) * โ€ฆ * (x - w^{n - 1})
mul_assign_skipping_d1 ๐Ÿ”’
Multiply l by r element-wise over d8, skipping the d1 rows โ€“ the indices that are multiples of 8, since d8 = 8 * d1. The permutation contribution vanishes on all of d1, so those rows are left at the zero that building the terms produced; only the non-d1 products need computing.
permutation_vanishing_polynomial
The polynomial (x - w^{n - zk_rows}) * (x - w^{n - zk_rows + 1}) * (x - w^{n - 1})
vanishes_on_last_n_rows
The polynomial (x - w^{n - i}) * (x - w^{n - i + 1}) * โ€ฆ * (x - w^{n - 1})
zk_w
Returns the end of the circuit, which is used for introducing zero-knowledge in the permutation polynomial