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