Skip to content

Commit c1f81f5

Browse files
author
notnotraju
committed
added a sketch of lookup argument.
1 parent fe7696f commit c1f81f5

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
186186
* which must be constrained somewhere else by a multiset argument. We detail this below.
187187
* 4. `q_add`, `q_skew`, and `q_double` are pairwise mutually exclusive.
188188
* 5. `q_add1 == 1` iff either `q_add == 1` OR `q_skew == 1`.
189-
* 6. The lookup table is implemented correctly. RAJU: check
189+
* 6. The lookup table is implemented correctly.
190190
*
191191
* First of all, note the asymmetry: we do not explicitly add tuples corresponding to skew on the MSM side of the
192192
* table. Indeeed, this in implicit with `msm_round == 32`. Now, the point is that the pair (pc, round) uniquely
@@ -203,10 +203,10 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
203203
* we are at the end of a `round` (so e.g. `q_add4 ` _should_ be 0), or we are at a double row, or we are at a row
204204
* that should be all 0s. In the first two cases, as long as the Precomputed table is correctly constrained, again
205205
* we would be adding a tuple to the multiset that can never be hit by the Precomputed table due to `precompute_pc`
206-
* monotonicty and `precompute_round` periodicity(enforced in the precomputed columns.). In the final case, the only
207-
* way we don't break the multiset check is if `wnaf_slice == 0` for the corresponding `q_addK` that is on. But then
208-
* the lookup argument will fail, as there is no corresponding point when `pc = 0`. (Here it is helpful to remember
209-
* that `pc` stands for _point-counter_.) RAJU: check the LOOKUP part.
206+
* monotonicty and `precompute_round` periodicity (enforced in the precomputed columns.). In the final case, the
207+
* only way we don't break the multiset check is if `wnaf_slice == 0` for the corresponding `q_addK` that is on. But
208+
* then the lookup argument will fail, as there is no corresponding point when `pc = 0`. (Here it is helpful to
209+
* remember that `pc` stands for _point-counter_.) Note that this requires that `precompute_pc` is well-formed.
210210
*
211211
*
212212
* We apply consistency/continuity checks to q_add1/q_add2/q_add3/q_add4:
@@ -233,6 +233,24 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
233233
*
234234
*/
235235

236+
/**
237+
* @brief Looking up the slice-point products {-15[P], -13[P], ..., 13[P], 15[P]}
238+
*
239+
* @details
240+
* In the Point Table, for every point [P] that occurs in the MSM table, we compute the list of points: {-15[P],
241+
* -13[P], ..., 13[P], 15[P]}. (Note that these never vanish, as we only send a point to each table if they are
242+
* non-zero.) We then constrain the "slice products" that occur here via a lookup argument. For completeness, we
243+
* briefly sketch this.
244+
*
245+
* The PointTable will "write" the following row to the lookup table: (pc, slice, x, y), where if `pc` corresponds
246+
* to an elliptic curve point [P] (`pc` is a decreasing counter of the non-zero points that occur in our
247+
* computation), slice ∈ {0, ..., 15}, and (x, y) are the affine coordinates of (2 * slice - 15)[P].
248+
*
249+
* The MSM table will then read a row of the same form. This constrains the MSM table to have correctly used the
250+
* wNAF * point in the Straus algorithm.
251+
*
252+
*/
253+
236254
/**
237255
* @brief Addition relation
238256
*
@@ -493,6 +511,7 @@ void ECCVMMSMRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulator
493511
// if q_skew == 1, then round == 32. This is almost certainly redundant but psychologically useful to "constrain
494512
// both ends".
495513
std::get<34>(accumulator) += q_skew * (-round + 32) * scaling_factor;
514+
496515
// UPDATING THE COUNT
497516

498517
// if we are changing the `round` (i.e., starting to process a new wNAF digit or at an msm transition), the

0 commit comments

Comments
 (0)