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