Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
siloing.cpp
Go to the documentation of this file.
1
#include "
barretenberg/vm2/simulation/gadgets/siloing.hpp
"
2
3
#include "
barretenberg/crypto/poseidon2/poseidon2.hpp
"
4
#include "
barretenberg/vm2/common/aztec_constants.hpp
"
5
#include "
barretenberg/vm2/simulation/events/siloing_event.hpp
"
6
7
namespace
bb::avm2::simulation
{
8
9
using
Poseidon2
=
crypto::Poseidon2<crypto::Poseidon2Bn254ScalarFieldParams>
;
10
11
FF
Siloing::silo
(
const
FF
& generator,
const
FF
& elem,
const
FF
& silo_by,
SiloingType
type)
12
{
13
// TODO: Cache and deduplicate.
14
// TODO: Use poseidon gadget.
15
auto
siloed_elem =
Poseidon2::hash
({ generator, silo_by, elem });
16
events
.emit({ .type = type, .elem = elem, .siloed_by = silo_by, .siloed_elem = siloed_elem });
17
return
siloed_elem;
18
}
19
20
}
// namespace bb::avm2::simulation
aztec_constants.hpp
bb::avm2::simulation::Poseidon2
Definition
poseidon2.hpp:15
bb::avm2::simulation::Siloing::events
EventEmitterInterface< SiloingEvent > & events
Definition
siloing.hpp:25
bb::avm2::simulation::Siloing::silo
FF silo(const FF &generator, const FF &elem, const FF &silo_by, SiloingType type)
Definition
siloing.cpp:11
bb::crypto::Poseidon2
Definition
poseidon2.hpp:15
bb::crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >::hash
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
poseidon2.hpp
siloing.hpp
bb::avm2::simulation
Definition
address_derivation_event.hpp:6
bb::avm2::simulation::SiloingType
SiloingType
Definition
siloing_event.hpp:7
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
siloing_event.hpp
src
barretenberg
vm2
simulation
gadgets
siloing.cpp
Generated by
1.9.8