Given a precomputed table of some table index Lookup a_i-th row and return result The result is a G1Affine element corresponding to [a_i] (2^(w.i) P)
(
table: (Vec<ark_bn254::G1Affine>, Script),
row_index: (usize, Script),
)
| 183 | // Lookup a_i-th row and return result |
| 184 | // The result is a G1Affine element corresponding to [a_i] (2^(w.i) P) |
| 185 | fn query_table( |
| 186 | table: (Vec<ark_bn254::G1Affine>, Script), |
| 187 | row_index: (usize, Script), |
| 188 | ) -> (ark_bn254::G1Affine, Script) { |
| 189 | let row = table.0[row_index.0]; |
| 190 | let scr = script! { |
| 191 | // [scalar] |
| 192 | {row_index.1} |
| 193 | // [scalar slice] => a_i |
| 194 | {table.1} |
| 195 | // [a_i] (2 ^ (w.i) P) |
| 196 | }; |
| 197 | (row, scr) |
| 198 | } |
| 199 | |
| 200 | /// Compute: Sum of [a_i] (2^ (wi) P) for i = 0..N, N is the number of terms in addition chain |
| 201 | /// BATCH_SIZE_PER_CHUNK such terms are batached inside a chunk |
no outgoing calls