Skip to content

Commit 0d16a57

Browse files
committed
missing columns in AIR table for poseidons 24
1 parent c2d3dbb commit 0d16a57

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

crates/lean_prover/src/common.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ pub fn get_base_dims(
1313
private_memory_len: usize,
1414
bytecode_ending_pc: usize,
1515
poseidon_counts: (usize, usize),
16-
poseidon_widths: (usize, usize),
1716
n_rows_table_dot_products: usize,
1817
) -> Vec<ColDims<F>> {
1918
let (n_poseidons_16, n_poseidons_24) = poseidon_counts;
20-
let (p16_air_width, p24_air_width) = poseidon_widths;
2119
let default_p16_row =
2220
default_poseidon16_air_row(POSEIDON_16_DEFAULT_COMPRESSION, POSEIDON_16_NULL_HASH_PTR);
2321
let default_p24_row = default_poseidon24_air_row();
@@ -36,10 +34,10 @@ pub fn get_base_dims(
3634
ColDims::padded(n_poseidons_24, F::from_usize(ZERO_VEC_PTR)), // poseidon24 index b
3735
ColDims::padded(n_poseidons_24, F::from_usize(POSEIDON_24_NULL_HASH_PTR)), // poseidon24 index res
3836
],
39-
(0..p16_air_width - 16 * 2)
37+
(0..POSEIDON16_AIR_N_COLS - 16 * 2)
4038
.map(|i| ColDims::padded(n_poseidons_16, default_p16_row[16 + i]))
4139
.collect::<Vec<_>>(), // rest of poseidon16 table
42-
(0..p24_air_width - 24 * 2)
40+
(0..POSEIDON24_AIR_N_COLS - 24 - 8)
4341
.map(|i| ColDims::padded(n_poseidons_24, default_p24_row[24 + i]))
4442
.collect::<Vec<_>>(), // rest of poseidon24 table
4543
vec![

crates/lean_prover/src/prove_execution.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ pub fn prove_execution(
167167
private_memory.len(),
168168
bytecode.ending_pc,
169169
(n_poseidons_16, n_poseidons_24),
170-
(p16_air.width(), p24_air.width()),
171170
n_rows_table_dot_products,
172171
);
173172

@@ -193,7 +192,7 @@ pub fn prove_execution(
193192
.iter()
194193
.map(Vec::as_slice)
195194
.collect::<Vec<_>>(),
196-
p24_columns[24..p24_air.width() - 24]
195+
p24_columns[24..p24_air.width() - 8]
197196
.iter()
198197
.map(Vec::as_slice)
199198
.collect::<Vec<_>>(),
@@ -560,7 +559,7 @@ pub fn prove_execution(
560559
let p24_columns_ref = p24_columns.iter().map(Vec::as_slice).collect::<Vec<_>>();
561560
let (p24_air_point, p24_evals_to_prove) = info_span!("Poseidon-24 AIR proof")
562561
.in_scope(|| p24_table.prove_base(&mut prover_state, UNIVARIATE_SKIPS, &p24_columns_ref));
563-
let p24_statements = p24_evals_to_prove[24..p24_air.width() - 24]
562+
let p24_statements = p24_evals_to_prove[24..p24_air.width() - 8]
564563
.iter()
565564
.map(|&e| vec![Evaluation::new(p24_air_point.clone(), e)])
566565
.collect();

crates/lean_prover/src/verify_execution.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ pub fn verify_execution(
111111
private_memory_len,
112112
bytecode.ending_pc,
113113
(n_poseidons_16, n_poseidons_24),
114-
(p16_air.width(), p24_air.width()),
115114
n_rows_table_dot_products,
116115
);
117116

@@ -360,7 +359,7 @@ pub fn verify_execution(
360359
p16_grand_product_evals_on_indexes_res,
361360
));
362361

363-
let p24_statements = p24_evals_to_verify[24..p24_air.width() - 24]
362+
let p24_statements = p24_evals_to_verify[24..p24_air.width() - 8]
364363
.iter()
365364
.map(|&e| vec![Evaluation::new(p24_air_point.clone(), e)])
366365
.collect();

0 commit comments

Comments
 (0)