diff --git a/hashes/zkevm/src/keccak/component/circuit/shard.rs b/hashes/zkevm/src/keccak/component/circuit/shard.rs index 469cee39..7c3ac86a 100644 --- a/hashes/zkevm/src/keccak/component/circuit/shard.rs +++ b/hashes/zkevm/src/keccak/component/circuit/shard.rs @@ -243,6 +243,13 @@ impl KeccakComponentShardCircuit { } } + /// Set inputs of [KeccakComponentShardCircuit], **overwriting** any old inputs. + pub fn feed_input(&mut self, inputs: Vec>) { + let input_size = inputs.iter().map(|input| get_num_keccak_f(input.len())).sum::(); + assert!(input_size < self.params.capacity, "Input size exceeds capacity"); + self.inputs = inputs; + } + /// Get break points of BaseCircuitBuilder. pub fn base_circuit_break_points(&self) -> MultiPhaseThreadBreakPoints { self.base_circuit_builder.borrow().break_points()