Skip to content

Commit

Permalink
Round paranoid
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgoergens committed Dec 9, 2024
1 parent 52418da commit cfb586c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ceno_zkvm/src/tables/ram/ram_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ pub trait DynVolatileRamTable {
fn name() -> &'static str;

fn max_len(params: &ProgramParams) -> usize {
let max_size = (Self::end_addr(params) - Self::offset_addr(params)) as usize;
let max_len: usize = max_size.next_power_of_two().div_ceil(WORD_SIZE);
let max_size = (Self::end_addr(params) as usize).div_ceil(WORD_SIZE)
- (Self::offset_addr(params) as usize) / WORD_SIZE;
let max_len: usize = max_size.next_power_of_two();
assert!(
max_size <= max_len,
"Did not round up {max_size} correctly, got {max_len}, which is smaller."
Expand Down

0 comments on commit cfb586c

Please sign in to comment.