Skip to content

Commit fee9d2c

Browse files
committed
wip4
1 parent 240beb6 commit fee9d2c

File tree

3 files changed

+367
-452
lines changed

3 files changed

+367
-452
lines changed

extensions/native/circuit/src/poseidon2/chip.rs

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ use openvm_stark_backend::{
2323
p3_maybe_rayon::prelude::{IntoParallelIterator, ParallelSliceMut, *},
2424
};
2525

26-
use crate::poseidon2::{
27-
columns::{
28-
InsideRowSpecificCols, MultiObserveCols, NativePoseidon2Cols, SimplePoseidonSpecificCols,
29-
TopLevelSpecificCols,
26+
use crate::{
27+
mem_fill_helper,
28+
poseidon2::{
29+
columns::{
30+
InsideRowSpecificCols, MultiObserveCols, NativePoseidon2Cols,
31+
SimplePoseidonSpecificCols, TopLevelSpecificCols,
32+
},
33+
CHUNK,
3034
},
31-
CHUNK,
35+
tracing_read_native_helper,
3236
};
3337

3438
#[derive(Clone)]
@@ -1240,24 +1244,3 @@ impl<F: PrimeField32, const SBOX_REGISTERS: usize> NativePoseidon2Filler<F, SBOX
12401244
&inner.ending_full_rounds.last().unwrap().post
12411245
}
12421246
}
1243-
1244-
fn tracing_read_native_helper<F: PrimeField32, const BLOCK_SIZE: usize>(
1245-
memory: &mut TracingMemory,
1246-
ptr: u32,
1247-
base_aux: &mut MemoryBaseAuxCols<F>,
1248-
) -> [F; BLOCK_SIZE] {
1249-
let mut prev_ts = 0;
1250-
let ret = tracing_read_native(memory, ptr, &mut prev_ts);
1251-
base_aux.set_prev(F::from_canonical_u32(prev_ts));
1252-
ret
1253-
}
1254-
1255-
/// Fill `MemoryBaseAuxCols`, assuming that the `prev_timestamp` is already set in `base_aux`.
1256-
fn mem_fill_helper<F: PrimeField32>(
1257-
mem_helper: &MemoryAuxColsFactory<F>,
1258-
timestamp: u32,
1259-
base_aux: &mut MemoryBaseAuxCols<F>,
1260-
) {
1261-
let prev_ts = base_aux.prev_timestamp.as_canonical_u32();
1262-
mem_helper.fill(prev_ts, timestamp, base_aux);
1263-
}

0 commit comments

Comments
 (0)