Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
address_derivation.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
barretenberg/vm2/common/aztec_types.hpp
"
4
#include "
barretenberg/vm2/common/set.hpp
"
5
#include "
barretenberg/vm2/simulation/events/address_derivation_event.hpp
"
6
#include "
barretenberg/vm2/simulation/events/event_emitter.hpp
"
7
#include "
barretenberg/vm2/simulation/gadgets/ecc.hpp
"
8
#include "
barretenberg/vm2/simulation/gadgets/poseidon2.hpp
"
9
#include "
barretenberg/vm2/simulation/interfaces/address_derivation.hpp
"
10
11
namespace
bb::avm2::simulation
{
12
13
class
AddressDerivation
:
public
AddressDerivationInterface
{
14
public
:
15
AddressDerivation
(
Poseidon2Interface
&
poseidon2
,
16
EccInterface
&
ecc
,
17
EventEmitterInterface<AddressDerivationEvent>
&
events
)
18
:
events
(
events
)
19
,
poseidon2
(
poseidon2
)
20
,
ecc
(
ecc
)
21
{}
22
23
void
assert_derivation
(
const
AztecAddress
& address,
const
ContractInstance
& instance)
override
;
24
25
private
:
26
EventEmitterInterface<AddressDerivationEvent>
&
events
;
27
Poseidon2Interface
&
poseidon2
;
28
EccInterface
&
ecc
;
29
30
// Cache for address derivations to avoid repeating derivations
31
unordered_flat_set<AztecAddress>
cached_derivations
;
32
};
33
34
}
// namespace bb::avm2::simulation
address_derivation_event.hpp
aztec_types.hpp
bb::avm2::ecc
Definition
ecc.hpp:34
bb::avm2::simulation::AddressDerivation
Definition
address_derivation.hpp:13
bb::avm2::simulation::AddressDerivation::AddressDerivation
AddressDerivation(Poseidon2Interface &poseidon2, EccInterface &ecc, EventEmitterInterface< AddressDerivationEvent > &events)
Definition
address_derivation.hpp:15
bb::avm2::simulation::AddressDerivation::cached_derivations
unordered_flat_set< AztecAddress > cached_derivations
Definition
address_derivation.hpp:31
bb::avm2::simulation::AddressDerivation::assert_derivation
void assert_derivation(const AztecAddress &address, const ContractInstance &instance) override
Definition
address_derivation.cpp:10
bb::avm2::simulation::AddressDerivation::poseidon2
Poseidon2Interface & poseidon2
Definition
address_derivation.hpp:27
bb::avm2::simulation::AddressDerivation::ecc
EccInterface & ecc
Definition
address_derivation.hpp:28
bb::avm2::simulation::AddressDerivation::events
EventEmitterInterface< AddressDerivationEvent > & events
Definition
address_derivation.hpp:26
bb::avm2::simulation::AddressDerivationInterface
Definition
address_derivation.hpp:7
bb::avm2::simulation::EccInterface
Definition
ecc.hpp:12
bb::avm2::simulation::EventEmitterInterface
Definition
event_emitter.hpp:10
bb::avm2::simulation::Poseidon2Interface
Definition
poseidon2.hpp:14
bb::crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >
event_emitter.hpp
bb::avm2::simulation
Definition
address_derivation_event.hpp:6
bb::avm2::unordered_flat_set
::ankerl::unordered_dense::set< Key > unordered_flat_set
Definition
set.hpp:11
bb::avm2::AztecAddress
FF AztecAddress
Definition
aztec_types.hpp:12
set.hpp
ecc.hpp
address_derivation.hpp
bb::avm2::ContractInstance
Definition
aztec_types.hpp:85
poseidon2.hpp
src
barretenberg
vm2
simulation
gadgets
address_derivation.hpp
Generated by
1.9.8