diff --git a/aggregator/src/aggregation/decoder.rs b/aggregator/src/aggregation/decoder.rs index 82dd101da3..2c4956fd9b 100644 --- a/aggregator/src/aggregation/decoder.rs +++ b/aggregator/src/aggregation/decoder.rs @@ -4646,7 +4646,7 @@ impl DecoderConfig { || "byte_idx", self.byte_idx, idx, - || Value::known(Fr::from(last_byte_idx as u64)), + || Value::known(Fr::from(last_byte_idx + 1 as u64)), )?; padding_count -= 1; } diff --git a/aggregator/src/aggregation/decoder/witgen.rs b/aggregator/src/aggregation/decoder/witgen.rs index 5abf6457e8..e91215abba 100644 --- a/aggregator/src/aggregation/decoder/witgen.rs +++ b/aggregator/src/aggregation/decoder/witgen.rs @@ -1497,15 +1497,9 @@ fn process_sequences( (current_byte_idx, current_bit_idx) = increment_idx(current_byte_idx, current_bit_idx); } } else if nb > 0 && next_nb == 0 { - if to_bit_idx == 7 || to_bit_idx == 15 || to_bit_idx == 23 { - tail_holding_bit = true; - for _ in 0..(nb - skipped_bits - 1) { - (current_byte_idx, current_bit_idx) = increment_idx(current_byte_idx, current_bit_idx); - } - } else { - for _ in 0..(nb - skipped_bits) { - (current_byte_idx, current_bit_idx) = increment_idx(current_byte_idx, current_bit_idx); - } + tail_holding_bit = true; + for _ in 0..(nb - skipped_bits - 1) { + (current_byte_idx, current_bit_idx) = increment_idx(current_byte_idx, current_bit_idx); } } else if nb == 0 && next_nb > 0 { if tail_holding_bit {