kimchi/circuits/witness/
variable_cell.rs1use super::{variables::Variables, WitnessCell};
2use alloc::{boxed::Box, vec::Vec};
3use ark_ff::Field;
4
5pub struct VariableCell<'a> {
8 name: &'a str,
9}
10
11impl<'a> VariableCell<'a> {
12 pub fn create(name: &'a str) -> Box<VariableCell<'a>> {
14 Box::new(VariableCell { name })
15 }
16}
17
18impl<'a, F: Field, const W: usize> WitnessCell<F, F, W> for VariableCell<'a> {
19 fn value(&self, _witness: &mut [Vec<F>; W], variables: &Variables<F>, _index: usize) -> F {
20 variables[self.name]
21 }
22}