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
5
6namespace bb::avm2 {
7
8template <typename FF_>
9template <typename ContainerOverSubrelations, typename AllEntities>
10void address_derivationImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
11 const AllEntities& in,
12 [[maybe_unused]] const RelationParameters<FF_>&,
13 [[maybe_unused]] const FF_& scaling_factor)
14{
15 using C = ColumnAndShifts;
16
17 PROFILE_THIS_NAME("accumulate/address_derivation");
18
19 const auto constants_GRUMPKIN_ONE_X = FF(1);
20 const auto constants_GRUMPKIN_ONE_Y =
21 FF(uint256_t{ 9457493854555940652UL, 3253583849847263892UL, 14921373847124204899UL, 2UL });
22 const auto constants_GENERATOR_INDEX__CONTRACT_ADDRESS_V1 = FF(15);
23 const auto constants_GENERATOR_INDEX__PARTIAL_ADDRESS = FF(27);
24 const auto constants_GENERATOR_INDEX__PUBLIC_KEYS_HASH = FF(52);
25
26 {
28 auto tmp = in.get(C::address_derivation_sel) * (FF(1) - in.get(C::address_derivation_sel));
29 tmp *= scaling_factor;
30 std::get<0>(evals) += typename Accumulator::View(tmp);
31 }
32 {
33 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
34 auto tmp = in.get(C::address_derivation_sel) * (in.get(C::address_derivation_partial_address_domain_separator) -
35 constants_GENERATOR_INDEX__PARTIAL_ADDRESS);
36 tmp *= scaling_factor;
37 std::get<1>(evals) += typename Accumulator::View(tmp);
38 }
39 {
40 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
41 auto tmp =
42 in.get(C::address_derivation_sel) * (in.get(C::address_derivation_public_keys_hash_domain_separator) -
43 constants_GENERATOR_INDEX__PUBLIC_KEYS_HASH);
44 tmp *= scaling_factor;
45 std::get<2>(evals) += typename Accumulator::View(tmp);
46 }
47 {
48 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
49 auto tmp = in.get(C::address_derivation_sel) * (in.get(C::address_derivation_preaddress_domain_separator) -
50 constants_GENERATOR_INDEX__CONTRACT_ADDRESS_V1);
51 tmp *= scaling_factor;
52 std::get<3>(evals) += typename Accumulator::View(tmp);
53 }
54 {
55 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
56 auto tmp = in.get(C::address_derivation_sel) * (in.get(C::address_derivation_g1_x) - constants_GRUMPKIN_ONE_X);
57 tmp *= scaling_factor;
58 std::get<4>(evals) += typename Accumulator::View(tmp);
59 }
60 {
61 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
62 auto tmp = in.get(C::address_derivation_sel) * (in.get(C::address_derivation_g1_y) - constants_GRUMPKIN_ONE_Y);
63 tmp *= scaling_factor;
64 std::get<5>(evals) += typename Accumulator::View(tmp);
65 }
66}
67
68} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:35
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define PROFILE_THIS_NAME(name)
Definition op_count.hpp:16
Container for parameters used by the grand product (permutation, lookup) Honk relations.