kimchi/circuits/witness/
copy_shift_cell.rs1use super::{variables::Variables, WitnessCell};
2use alloc::{boxed::Box, vec::Vec};
3use ark_ff::Field;
4
5pub struct CopyShiftCell {
7 row: usize,
8 col: usize,
9 shift: u64,
10}
11
12impl CopyShiftCell {
13 pub fn create(row: usize, col: usize, shift: u64) -> Box<CopyShiftCell> {
15 Box::new(CopyShiftCell { row, col, shift })
16 }
17}
18
19impl<F: Field, const W: usize> WitnessCell<F, F, W> for CopyShiftCell {
20 fn value(&self, witness: &mut [Vec<F>; W], _variables: &Variables<F>, _index: usize) -> F {
21 F::from(2u32).pow([self.shift]) * witness[self.col][self.row]
22 }
23}