From f9d74cc50ed1c780226853b07260e495f7050ae7 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Thu, 7 Mar 2024 14:07:25 +0100 Subject: [PATCH 1/2] Kimchi/Expr: adding documentation for ChallengeTerm structure --- kimchi/src/circuits/expr.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kimchi/src/circuits/expr.rs b/kimchi/src/circuits/expr.rs index fced63114c..f564a0d2d0 100644 --- a/kimchi/src/circuits/expr.rs +++ b/kimchi/src/circuits/expr.rs @@ -247,6 +247,17 @@ pub struct Variable { pub row: CurrOrNext, } +/// Define challenges the verifier coins during the interactive protocol. +/// It has been defined initially to handle the PLONK IOP, hence: +/// - `alpha` for the quotient polynomial +/// - `beta` and `gamma` for the permutation challenges. +/// The joint combiner is to handle vector lookups, initially designed to be +/// used with PLOOKUP. +/// The terms have no built-in semantic in the expression framework, and can be +/// used for any other four challenges the verifier coins in other polynomial +/// interactive protocol. +/// TODO: we should generalize the expression type over challenges and constants. +/// See #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum ChallengeTerm { Alpha, From d73cdc65eb84711c237764b731525eeed50cf9d4 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Thu, 7 Mar 2024 14:42:13 +0100 Subject: [PATCH 2/2] Kimchi/Expr: document ConstantTerm --- kimchi/src/circuits/expr.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kimchi/src/circuits/expr.rs b/kimchi/src/circuits/expr.rs index f564a0d2d0..ca7784a4ae 100644 --- a/kimchi/src/circuits/expr.rs +++ b/kimchi/src/circuits/expr.rs @@ -266,6 +266,15 @@ pub enum ChallengeTerm { JointCombiner, } +/// Define the constant terms an expression can use. +/// It can be any constant term (`Literal`), a matrix (`Mds` - used by the +/// permutation used by Poseidon for instance), or endomorphism coefficients +/// (`EndoCoefficient` - used as an optimisation). +/// As for `challengeTerm`, it has been used initially to implement the PLONK +/// IOP, with the custom gate Poseidon. However, the terms have no built-in +/// semantic in the expression framework. +/// TODO: we should generalize the expression type over challenges and constants. +/// See #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub enum ConstantTerm { EndoCoefficient,