Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bytecode_hashing.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstdint>
4
#include <vector>
5
6
#include "
barretenberg/vm2/common/aztec_types.hpp
"
7
#include "
barretenberg/vm2/simulation/events/bytecode_events.hpp
"
8
#include "
barretenberg/vm2/simulation/events/event_emitter.hpp
"
9
#include "
barretenberg/vm2/simulation/interfaces/bytecode_hashing.hpp
"
10
#include "
barretenberg/vm2/simulation/interfaces/poseidon2.hpp
"
11
12
namespace
bb::avm2::simulation
{
13
14
class
BytecodeHasher
:
public
BytecodeHashingInterface
{
15
public
:
16
BytecodeHasher
(
Poseidon2Interface
&
hasher
,
EventEmitterInterface<BytecodeHashingEvent>
&
events
)
17
:
events
(
events
)
18
,
hasher
(
hasher
)
19
{}
20
21
void
assert_public_bytecode_commitment
(
const
BytecodeId
& bytecode_id,
22
const
std::vector<uint8_t>&
bytecode
)
override
;
23
24
private
:
25
EventEmitterInterface<BytecodeHashingEvent>
&
events
;
26
Poseidon2Interface
&
hasher
;
27
};
28
29
}
// namespace bb::avm2::simulation
bytecode
std::shared_ptr< Napi::ThreadSafeFunction > bytecode
Definition
avm_simulate_napi.cpp:131
aztec_types.hpp
bytecode_events.hpp
bb::avm2::simulation::BytecodeHasher
Definition
bytecode_hashing.hpp:14
bb::avm2::simulation::BytecodeHasher::assert_public_bytecode_commitment
void assert_public_bytecode_commitment(const BytecodeId &bytecode_id, const std::vector< uint8_t > &bytecode) override
Verify that the given bytecode_id matches the expected bytecode commitment which is a Poseidon2 hash ...
Definition
bytecode_hashing.cpp:24
bb::avm2::simulation::BytecodeHasher::BytecodeHasher
BytecodeHasher(Poseidon2Interface &hasher, EventEmitterInterface< BytecodeHashingEvent > &events)
Definition
bytecode_hashing.hpp:16
bb::avm2::simulation::BytecodeHasher::events
EventEmitterInterface< BytecodeHashingEvent > & events
Definition
bytecode_hashing.hpp:25
bb::avm2::simulation::BytecodeHasher::hasher
Poseidon2Interface & hasher
Definition
bytecode_hashing.hpp:26
bb::avm2::simulation::BytecodeHashingInterface
Definition
bytecode_hashing.hpp:10
bb::avm2::simulation::EventEmitterInterface
Definition
event_emitter.hpp:11
bb::avm2::simulation::Poseidon2Interface
Definition
poseidon2.hpp:22
event_emitter.hpp
bytecode_hashing.hpp
bb::avm2::simulation
AVM range check gadget for witness generation.
Definition
address_derivation_event.hpp:6
bb::avm2::BytecodeId
FF BytecodeId
Definition
aztec_types.hpp:17
poseidon2.hpp
src
barretenberg
vm2
simulation
gadgets
bytecode_hashing.hpp
Generated by
1.9.8