Skip to content

Commit

Permalink
Correct bitstream decoding idx
Browse files Browse the repository at this point in the history
  • Loading branch information
darth-cy committed May 14, 2024
1 parent a315012 commit 284acfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion aggregator/src/aggregation/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
12 changes: 3 additions & 9 deletions aggregator/src/aggregation/decoder/witgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1497,15 +1497,9 @@ fn process_sequences<F: Field>(
(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 {
Expand Down

0 comments on commit 284acfe

Please sign in to comment.