Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
siloing.cpp
Go to the documentation of this file.
2
6
7namespace bb::avm2::simulation {
8
9using Poseidon2 = crypto::Poseidon2<crypto::Poseidon2Bn254ScalarFieldParams>;
10
11FF 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
EventEmitterInterface< SiloingEvent > & events
Definition siloing.hpp:30
FF silo(const FF &generator, const FF &elem, const FF &silo_by, SiloingType type)
Definition siloing.cpp:11
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
Implements a parallelized batch insertion indexed tree Accepts template argument of the type of store...
AvmFlavorSettings::FF FF
Definition field.hpp:10