Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
address_derivation_trace.cpp
Go to the documentation of this file.
2
3#include <memory>
4
12
13namespace bb::avm2::tracegen {
14
38 TraceContainer& trace)
39{
40 using C = Column;
41
43
44 uint32_t row = 0;
45 for (const auto& event : events) {
46 trace.set(
47 row,
48 { { { C::address_derivation_sel, 1 },
49 // Address.
50 { C::address_derivation_address, event.address },
51 // Contract instance members.
52 { C::address_derivation_salt, event.instance.salt },
53 { C::address_derivation_deployer_addr, event.instance.deployer },
54 { C::address_derivation_class_id, event.instance.original_contract_class_id },
55 { C::address_derivation_init_hash, event.instance.initialization_hash },
56 { C::address_derivation_immutables_hash, event.instance.immutables_hash },
57 // Public keys: only ivpk_m as a point, the other five as hashes.
58 { C::address_derivation_nullifier_key_hash, event.instance.public_keys.nullifier_key_hash },
59 { C::address_derivation_incoming_viewing_key_x, event.instance.public_keys.incoming_viewing_key.x },
60 { C::address_derivation_incoming_viewing_key_y, event.instance.public_keys.incoming_viewing_key.y },
61 { C::address_derivation_outgoing_viewing_key_hash,
62 event.instance.public_keys.outgoing_viewing_key_hash },
63 { C::address_derivation_tagging_key_hash, event.instance.public_keys.tagging_key_hash },
64 { C::address_derivation_message_signing_key_hash, event.instance.public_keys.message_signing_key_hash },
65 { C::address_derivation_fallback_key_hash, event.instance.public_keys.fallback_key_hash },
66 // Intermediate hash results.
67 { C::address_derivation_salted_init_hash, event.salted_initialization_hash },
68 { C::address_derivation_partial_address, event.partial_address },
69 { C::address_derivation_incoming_viewing_key_hash, event.incoming_viewing_key_hash },
70 { C::address_derivation_public_keys_hash, event.public_keys_hash },
71 { C::address_derivation_preaddress, event.preaddress },
72 // Intermediate EC results.
73 { C::address_derivation_preaddress_public_key_x, event.preaddress_public_key.x() },
74 { C::address_derivation_preaddress_public_key_y, event.preaddress_public_key.y() },
75 { C::address_derivation_address_y, event.address_point.y() },
76 // Constant columns (this is temp because aliasing is not allowed in lookups).
77 { C::address_derivation_salted_init_hash_domain_separator, DOM_SEP__SALTED_INITIALIZATION_HASH },
78 { C::address_derivation_partial_address_domain_separator, DOM_SEP__PARTIAL_ADDRESS },
79 { C::address_derivation_single_public_key_hash_domain_separator, DOM_SEP__SINGLE_PUBLIC_KEY_HASH },
80 { C::address_derivation_public_keys_hash_domain_separator, DOM_SEP__PUBLIC_KEYS_HASH },
81 { C::address_derivation_preaddress_domain_separator, DOM_SEP__CONTRACT_ADDRESS_V2 },
82 { C::address_derivation_g1_x, g1.x() },
83 { C::address_derivation_g1_y, g1.y() },
84 { C::address_derivation_const_two, 2 },
85 { C::address_derivation_const_three, 3 },
86 { C::address_derivation_const_five, 5 },
87 { C::address_derivation_const_seven, 7 } } });
88 row++;
89 }
90}
91
99 .add<InteractionType::LookupSequential, lookup_address_derivation_ivpk_m_hash_poseidon2_settings>()
101 .add<InteractionType::LookupSequential, lookup_address_derivation_public_keys_hash_poseidon2_1_settings>()
103 .add<InteractionType::LookupSequential, lookup_address_derivation_preaddress_poseidon2_settings>()
105 .add<InteractionType::LookupSequential, lookup_address_derivation_address_ecadd_settings>();
106
107} // namespace bb::avm2::tracegen
#define DOM_SEP__SALTED_INITIALIZATION_HASH
#define DOM_SEP__SINGLE_PUBLIC_KEY_HASH
#define DOM_SEP__CONTRACT_ADDRESS_V2
#define DOM_SEP__PARTIAL_ADDRESS
#define DOM_SEP__PUBLIC_KEYS_HASH
void process(const simulation::EventEmitterInterface< simulation::AddressDerivationEvent >::Container &events, TraceContainer &trace)
Process address derivation events and populate the relevant columns in the trace. Corresponds to the ...
InteractionDefinition & add(auto &&... args)
group class. Represents an elliptic curve group element. Group is parametrised by Fq and Fr
Definition group.hpp:38
TestTraceContainer trace
simulation::PublicDataTreeReadWriteEvent event
Settings to be passed ot GenericLookupRelationImpl.