Fix arithmetic stark padding (#1069)

This commit is contained in:
Robin Salen 2023-06-02 18:51:21 +02:00 committed by GitHub
parent 0d819cf888
commit 49bbe4e084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,8 +138,10 @@ impl<F: RichField, const D: usize> ArithmeticStark<F, D> {
}
// Pad the trace with zero rows if it doesn't have enough rows
// to accommodate the range check columns.
for _ in trace_rows.len()..RANGE_MAX {
// to accommodate the range check columns. Also make sure the
// trace length is a power of two.
let padded_len = trace_rows.len().next_power_of_two();
for _ in trace_rows.len()..std::cmp::max(padded_len, RANGE_MAX) {
trace_rows.push(vec![F::ZERO; columns::NUM_ARITH_COLUMNS]);
}