Module constraints

Source
Expand description

This module implements Plonk circuit constraint primitive.

Structs§

Builder
ColumnEvaluations
The polynomials representing columns, in evaluation form. The evaluations are expanded to the domain size required for their constraints.
ConstraintSystem
EvaluatedColumnCoefficients
The polynomials representing evaluated columns, in coefficient form.
FeatureFlags
Flags for optional features in the constraint system

Enums§

GateError
Represents an error found when verifying a witness with a gate

Constants§

NUM_CHUNKS_BY_DEFAULT
The default number of chunks in a circuit is one (< 2^16 rows)
ZK_ROWS_BY_DEFAULT
The number of rows required for zero knowledge in circuits with one single chunk

Functions§

selector_polynomial
Create selector polynomial for a circuit gate
zk_rows_strict_lower_bound
This function computes a strict lower bound in the number of rows required for zero knowledge in circuits with num_chunks chunks. This means that at least one needs 1 more row than the result of this function to achieve zero knowledge. Example: for 1 chunk, this function returns 2, but at least 3 rows are needed Note: the number of zero knowledge rows is usually computed across the codebase as the formula (16 * num_chunks + 5) / 7, which is precisely the formula in this function plus one.