Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
address_derivation_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void address_derivationImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
12 const AllEntities& in,
13 [[maybe_unused]] const RelationParameters<FF_>&,
14 [[maybe_unused]] const FF_& scaling_factor)
15{
16 using C = ColumnAndShifts;
17
18 const auto constants_GRUMPKIN_ONE_X = FF(1);
19 const auto constants_GRUMPKIN_ONE_Y =
20 FF(uint256_t{ 9457493854555940652UL, 3253583849847263892UL, 14921373847124204899UL, 2UL });
21 const auto constants_GENERATOR_INDEX__CONTRACT_ADDRESS_V1 = FF(15);
22 const auto constants_GENERATOR_INDEX__PARTIAL_ADDRESS = FF(27);
23 const auto constants_GENERATOR_INDEX__PUBLIC_KEYS_HASH = FF(52);
24
25 {
26 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
27 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
28 (FF(1) - static_cast<View>(in.get(C::address_derivation_sel)));
29 std::get<0>(evals) += (tmp * scaling_factor);
30 }
31 {
32 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
33 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
34 (static_cast<View>(in.get(C::address_derivation_partial_address_domain_separator)) -
35 CView(constants_GENERATOR_INDEX__PARTIAL_ADDRESS));
36 std::get<1>(evals) += (tmp * scaling_factor);
37 }
38 {
39 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
40 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
41 (static_cast<View>(in.get(C::address_derivation_const_two)) - FF(2));
42 std::get<2>(evals) += (tmp * scaling_factor);
43 }
44 {
45 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
46 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
47 (static_cast<View>(in.get(C::address_derivation_const_three)) - FF(3));
48 std::get<3>(evals) += (tmp * scaling_factor);
49 }
50 {
51 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
52 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
53 (static_cast<View>(in.get(C::address_derivation_const_four)) - FF(4));
54 std::get<4>(evals) += (tmp * scaling_factor);
55 }
56 {
57 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
58 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
59 (static_cast<View>(in.get(C::address_derivation_const_five)) - FF(5));
60 std::get<5>(evals) += (tmp * scaling_factor);
61 }
62 {
63 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
64 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
65 (static_cast<View>(in.get(C::address_derivation_public_keys_hash_domain_separator)) -
66 CView(constants_GENERATOR_INDEX__PUBLIC_KEYS_HASH));
67 std::get<6>(evals) += (tmp * scaling_factor);
68 }
69 {
70 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
71 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
72 (static_cast<View>(in.get(C::address_derivation_preaddress_domain_separator)) -
73 CView(constants_GENERATOR_INDEX__CONTRACT_ADDRESS_V1));
74 std::get<7>(evals) += (tmp * scaling_factor);
75 }
76 {
77 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
78 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
79 (static_cast<View>(in.get(C::address_derivation_g1_x)) - CView(constants_GRUMPKIN_ONE_X));
80 std::get<8>(evals) += (tmp * scaling_factor);
81 }
82 {
83 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
84 auto tmp = static_cast<View>(in.get(C::address_derivation_sel)) *
85 (static_cast<View>(in.get(C::address_derivation_g1_y)) - CView(constants_GRUMPKIN_ONE_Y));
86 std::get<9>(evals) += (tmp * scaling_factor);
87 }
88}
89
90} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:34
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define CView(v)
Container for parameters used by the grand product (permutation, lookup) Honk relations.