@@ -9,7 +9,7 @@ use plonky2::iop::challenger::RecursiveChallenger;
9
9
use plonky2:: iop:: target:: Target ;
10
10
use serde:: { Deserialize , Serialize } ;
11
11
12
- use super :: { BoolVariable , ByteVariable , CircuitVariable , ValueStream , Variable , VariableStream } ;
12
+ use super :: { ByteVariable , CircuitVariable , ValueStream , Variable , VariableStream } ;
13
13
use crate :: backend:: circuit:: PlonkParameters ;
14
14
use crate :: frontend:: builder:: CircuitBuilder ;
15
15
use crate :: frontend:: hint:: simple:: hint:: Hint ;
@@ -264,12 +264,12 @@ impl<L: PlonkParameters<D>, const D: usize> CircuitBuilder<L, D> {
264
264
let at_start_idx = self . is_equal ( idx, start_idx) ;
265
265
within_sub_array = self . select ( at_start_idx, true_v, within_sub_array) ;
266
266
267
- subarray_size = self . add ( subarray_size, within_sub_array. variable ) ;
268
-
269
267
// If at the end_idx, then set within_sub_array to false.
270
268
let at_end_idx = self . is_equal ( idx, end_idx) ;
271
269
within_sub_array = self . select ( at_end_idx, false_v, within_sub_array) ;
272
270
271
+ subarray_size = self . add ( subarray_size, within_sub_array. variable ) ;
272
+
273
273
// If within the subarray, multiply the current r by the challenge.
274
274
let multiplier = self . select ( within_sub_array, challenges[ i] , one) ;
275
275
// For subarray[i], the multiplier should be r^i. i is the index within the subarray.
0 commit comments