Struct o1vm::interpreters::keccak::environment::KeccakEnv
source · pub struct KeccakEnv<F> {
pub constraints_env: ConstraintsEnv<F>,
pub witness_env: WitnessEnv<F>,
pub step: Option<Steps>,
/* private fields */
}
Expand description
This struct contains all that needs to be kept track of during the execution of the Keccak step interpreter
Fields§
§constraints_env: ConstraintsEnv<F>
Environment for the constraints (includes lookups). The step of the hash that is being executed can be None if just ended
witness_env: WitnessEnv<F>
Environment for the witness (includes multiplicities)
step: Option<Steps>
Current step
Implementations§
source§impl<F: Field> KeccakEnv<F>
impl<F: Field> KeccakEnv<F>
sourcepub fn new(hash_idx: u64, preimage: &[u8]) -> Self
pub fn new(hash_idx: u64, preimage: &[u8]) -> Self
Starts a new Keccak environment for a given hash index and bytestring of preimage data
sourcepub fn write_column(&mut self, column: KeccakColumn, value: u64)
pub fn write_column(&mut self, column: KeccakColumn, value: u64)
Writes an integer value to a column of the Keccak witness
sourcepub fn write_column_field(&mut self, column: KeccakColumn, value: F)
pub fn write_column_field(&mut self, column: KeccakColumn, value: F)
Writes a field value to a column of the Keccak witness
sourcepub fn null_state(&mut self)
pub fn null_state(&mut self)
Nullifies the Witness and Constraint environments by resetting it to default values (except for table-related) This way, each row only adds the constraints of that step (do not nullify the step)
sourcepub fn step(&mut self)
pub fn step(&mut self)
Entrypoint for the interpreter. It executes one step of the Keccak circuit (one row),
and updates the environment accordingly (including the witness and inter-step lookups).
When it finishes, it updates the value of the current step, so that the next call to
the step()
function executes the next step.
sourcepub fn update_step(&mut self)
pub fn update_step(&mut self)
This function updates the next step of the environment depending on the current step