@@ -15,13 +15,11 @@ use crate::{
1515} ;
1616use serde:: Deserialize ;
1717
18- /// A term of a linear constraint consisting of a triple (c, j, k), per [4.4.2][1]. This is one
18+ /// A term of a linear constraint consisting of a triple (c, j, k), per [4.4.2][1]. This is one
1919/// element of the the constraint matrix A for verifying that A * W = b. Several of these terms sum
2020/// together into one of the elements of `ProofConstraints::linear_constraint_rhs`.
2121///
2222/// [1]: https://datatracker.ietf.org/doc/html/draft-google-cfrg-libzk-01#section-4.4.2
23- // We don't yet examine these outside of test code, so allow dead code for now.
24- #[ allow( dead_code) ]
2523#[ derive( Debug , Clone , PartialEq , Eq ) ]
2624pub struct LinearConstraintLhsTerm < FieldElement > {
2725 /// The constraint number or row of A. This is an index into the vector `b`, which we represent
@@ -63,7 +61,11 @@ impl<FE: CodecFieldElement + LagrangePolynomialFieldElement> ProofConstraints<FE
6361 /// `sym_private_inputs`, but since the whole point is that we don't know what those values are,
6462 /// it doesn't make sense to represent them as arguments.
6563 ///
64+ /// `ligero_commitment` is the commitment computed per [4.3][1], which is needed to initialize
65+ /// the transcript.
66+ ///
6667 /// [1]: https://datatracker.ietf.org/doc/html/draft-google-cfrg-libzk-01#section-6.6
68+ /// [2]: https://datatracker.ietf.org/doc/html/draft-google-cfrg-libzk-01#section-4.3
6769 pub fn from_proof (
6870 circuit : & Circuit ,
6971 public_inputs : & [ FE ] ,
@@ -139,15 +141,15 @@ impl<FE: CodecFieldElement + LagrangePolynomialFieldElement> ProofConstraints<FE
139141 // =
140142 // Q * layer_proof.vl * layer_proof.vl - known_part
141143 //
142- // The LHS of this constraint will consist of two LinearConstraintTerms (p0 and p2) for
143- // each polynomial (for the symbolic manipulations needed to compute symbolic_part),\
144- // plus three more terms for this layer's vl, vr, vl*vr.
144+ // The LHS of this constraint will consist of two LinearConstraintTerms for the previous
145+ // layer's vl and vr (to compute this layer's claims), plus two terms (p0 and p2) for
146+ // each polynomial in the layer, plus three more terms for this layer's vl, vr, vl*vr.
145147 //
146148 // The RHS can be computed straightforwardly and so we get one element per layer.
147149 //
148150 // Q is the quad once reduced down to a single value, which is bound_quad[0][0] for us.
149151
150- // Known portion of initial claim.
152+ // Known portion of layer's initial claim.
151153 let mut claim_known = claims[ 0 ] + alpha * claims[ 1 ] ;
152154
153155 if layer_index > 0 {
@@ -478,7 +480,7 @@ mod tests {
478480
479481 let test_vector_constraints = test_vector. constraints . unwrap ( ) ;
480482 let test_vector_ligero_commitment =
481- hex:: decode ( & test_vector. ligero_commitment . as_ref ( ) . unwrap ( ) ) . unwrap ( ) ;
483+ hex:: decode ( test_vector. ligero_commitment . as_ref ( ) . unwrap ( ) ) . unwrap ( ) ;
482484
483485 let evaluation: Evaluation < FieldP128 > = circuit
484486 . evaluate ( & test_vector. valid_inputs . unwrap ( ) )
0 commit comments