43 for (
const auto&
event : events) {
45 size_t input_size =
event.calldata.size() + 1;
46 calldata_with_sep.reserve(input_size);
47 calldata_with_sep.insert(calldata_with_sep.end(),
event.calldata.begin(),
event.calldata.end());
51 while (input_size > 0) {
52 std::array<FF, 4> input = {};
53 size_t chunk_size = std::min(input_size,
static_cast<size_t>(3));
55 for (
size_t j = 0; j < chunk_size; j++) {
56 input[j] = calldata_with_sep[(round * 3) + j];
59 input_size -= chunk_size;
63 { C::cd_hashing_sel, 1 },
64 { C::cd_hashing_context_id,
event.context_id },
65 { C::cd_hashing_length_remaining, input_size },
66 { C::cd_hashing_input_0_, input[0] },
67 { C::cd_hashing_input_1_, input[1] },
68 { C::cd_hashing_input_2_, input[2] },
69 { C::cd_hashing_output_hash, input_size == 0 ? calldata_hash : 0 },
70 { C::cd_hashing_latch, (input_size == 0) ? 1 : 0 },