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 <memory>
4
5
#include "
barretenberg/vm2/simulation/events/bytecode_events.hpp
"
6
#include "
barretenberg/vm2/simulation/events/event_emitter.hpp
"
7
#include "
barretenberg/vm2/simulation/poseidon2.hpp
"
8
9
namespace
bb::avm2::simulation
{
10
11
class
BytecodeHashingInterface
{
12
public
:
13
virtual
~BytecodeHashingInterface
() =
default
;
14
virtual
FF
compute_public_bytecode_commitment
(
const
BytecodeId
bytecode_id,
15
const
std::vector<uint8_t>& bytecode) = 0;
16
};
17
18
class
BytecodeHasher
:
public
BytecodeHashingInterface
{
19
public
:
20
BytecodeHasher
(
Poseidon2Interface
&
hasher
,
EventEmitterInterface<BytecodeHashingEvent>
&
events
)
21
:
events
(
events
)
22
,
hasher
(
hasher
)
23
{}
24
25
FF
compute_public_bytecode_commitment
(
const
BytecodeId
bytecode_id,
const
std::vector<uint8_t>& bytecode)
override
;
26
27
private
:
28
[[maybe_unused]]
EventEmitterInterface<BytecodeHashingEvent>
&
events
;
29
Poseidon2Interface
&
hasher
;
30
};
31
32
}
// namespace bb::avm2::simulation
bytecode_events.hpp
bb::avm2::simulation::BytecodeHasher
Definition
bytecode_hashing.hpp:18
bb::avm2::simulation::BytecodeHasher::BytecodeHasher
BytecodeHasher(Poseidon2Interface &hasher, EventEmitterInterface< BytecodeHashingEvent > &events)
Definition
bytecode_hashing.hpp:20
bb::avm2::simulation::BytecodeHasher::events
EventEmitterInterface< BytecodeHashingEvent > & events
Definition
bytecode_hashing.hpp:28
bb::avm2::simulation::BytecodeHasher::hasher
Poseidon2Interface & hasher
Definition
bytecode_hashing.hpp:29
bb::avm2::simulation::BytecodeHasher::compute_public_bytecode_commitment
FF compute_public_bytecode_commitment(const BytecodeId bytecode_id, const std::vector< uint8_t > &bytecode) override
Definition
bytecode_hashing.cpp:8
bb::avm2::simulation::BytecodeHashingInterface
Definition
bytecode_hashing.hpp:11
bb::avm2::simulation::BytecodeHashingInterface::~BytecodeHashingInterface
virtual ~BytecodeHashingInterface()=default
bb::avm2::simulation::BytecodeHashingInterface::compute_public_bytecode_commitment
virtual FF compute_public_bytecode_commitment(const BytecodeId bytecode_id, const std::vector< uint8_t > &bytecode)=0
bb::avm2::simulation::EventEmitterInterface
Definition
event_emitter.hpp:10
bb::avm2::simulation::Poseidon2Interface
Definition
poseidon2.hpp:14
event_emitter.hpp
bb::avm2::simulation
Definition
address_derivation.cpp:8
bb::avm2::simulation::BytecodeId
FF BytecodeId
Definition
bytecode_events.hpp:16
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
poseidon2.hpp
src
barretenberg
vm2
simulation
bytecode_hashing.hpp
Generated by
1.9.8