Expand description
Core interface for working with various relations that are useful in zkSNARKs. At the moment, we only implement APIs for working with Generalized Rank-1 Constraint Systems (R1CS) (See https://eprint.iacr.org/2024/1245.pdf).
§Compatibility with R1CS
In previous versions, this crate only supported R1CS.
For ease of migration, a GR1CS instance is equipped with an R1CS predicate by default.
Also, there is a separate
enforce_r1cs_constraint function that has the same API as the enforce_constraint function
in previous versions.
Hence, by replacing the latter with the former and updating use statements,
you can migrate your code to the new version.
Modules§
- gr1cs
- The Generalized Rank-1 Constraint System (GR1CS) Infrastructure Core interface for working with Generalized Rank-1 Constraint Systems (GR1CS).
- sr1cs
- The Squared Rank-1 Constraint System (GR1CS) Infrastructure
- utils
- Functions and data structures needed for working with GR1CS
Macros§
- lc
- Generate a
LinearCombinationfrom arithmetic expressions involvingVariables. - lc_diff
- Generate a
LinearCombinationrepresenting the difference of two variables. - ns
- Creates namespaces for different parts of a circuit when generating constraints. Here, a namespace is equivalent to having a unique span for each part of the circuit. For more information on spans, see the tracing crate.