Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
calldata_hashing.cpp
Go to the documentation of this file.
2
6
7namespace bb::avm2::simulation {
8
10{
11 // todo(ilyas): this probably simulates faster at the cost of re-work in tracegen
12 std::vector<FF> calldata_with_sep = { GENERATOR_INDEX__PUBLIC_CALLDATA };
13 for (const auto& value : calldata) {
14 // Note: Using `insert` breaks GCC.
15 calldata_with_sep.push_back(value);
16 }
17 FF output_hash = hasher.hash(calldata_with_sep);
18
19 events.emit({
20 .context_id = context_id,
21 .calldata_size = static_cast<uint32_t>(calldata.size()),
22 .calldata = { calldata.begin(), calldata.end() },
23 });
24 return output_hash;
25}
26
27} // namespace bb::avm2::simulation
#define GENERATOR_INDEX__PUBLIC_CALLDATA
EventEmitterInterface< CalldataEvent > & events
FF compute_calldata_hash(std::span< const FF > calldata) override
virtual FF hash(const std::vector< FF > &input)=0
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13