Skip to content

Commit

Permalink
[chore] add feed_input for keccak circuit (#229)
Browse files Browse the repository at this point in the history
chore: add `feed_input` for keccak circuit
  • Loading branch information
jonathanpwang authored Dec 10, 2023
1 parent b6625fa commit 6e35ba3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hashes/zkevm/src/keccak/component/circuit/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ impl<F: Field> KeccakComponentShardCircuit<F> {
}
}

/// Set inputs of [KeccakComponentShardCircuit], **overwriting** any old inputs.
pub fn feed_input(&mut self, inputs: Vec<Vec<u8>>) {
let input_size = inputs.iter().map(|input| get_num_keccak_f(input.len())).sum::<usize>();
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()
Expand Down

0 comments on commit 6e35ba3

Please sign in to comment.