diff --git a/extensions/native/recursion/src/challenger/duplex.rs b/extensions/native/recursion/src/challenger/duplex.rs index c77a92e2c..a7ae768f7 100644 --- a/extensions/native/recursion/src/challenger/duplex.rs +++ b/extensions/native/recursion/src/challenger/duplex.rs @@ -145,10 +145,12 @@ impl DuplexChallengerVariable { pub fn check_witness(&mut self, builder: &mut Builder, nb_bits: usize, witness: Felt) { self.observe(builder, witness); let element_bits = self.sample_bits(builder, RVar::from(nb_bits)); - builder.range(0, nb_bits).for_each(|i, builder| { - let element = builder.get(&element_bits, i); - builder.assert_var_eq(element, C::N::ZERO); - }); + let element_bits_truncated = element_bits.slice(builder, 0, nb_bits); + builder + .iter(&element_bits_truncated) + .for_each(|element, builder| { + builder.assert_var_eq(element, C::N::ZERO); + }); } } @@ -158,8 +160,7 @@ impl CanObserveVariable> for DuplexChallengerVariable, values: Array>) { - builder.range(0, values.len()).for_each(|i, builder| { - let element = builder.get(&values, i); + builder.iter(&values).for_each(|element, builder| { self.observe(builder, element); }); }