Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
public_data_squash_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 public_data_squashImpl<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/public_data_squash");
18
19 const auto public_data_squash_START =
20 in.get(C::public_data_squash_sel_shift) * (FF(1) - in.get(C::public_data_squash_sel));
21 const auto public_data_squash_END =
22 in.get(C::public_data_squash_sel) * (FF(1) - in.get(C::public_data_squash_sel_shift));
23 const auto public_data_squash_NOT_END = in.get(C::public_data_squash_sel) * in.get(C::public_data_squash_sel_shift);
24 const auto public_data_squash_LEAF_SLOT_END =
25 in.get(C::public_data_squash_leaf_slot_increase) + public_data_squash_END;
26
27 {
28 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
29 auto tmp = in.get(C::public_data_squash_sel) * (FF(1) - in.get(C::public_data_squash_sel));
30 tmp *= scaling_factor;
31 std::get<0>(evals) += typename Accumulator::View(tmp);
32 }
33 { // START_CONDITION
34 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
35 auto tmp = public_data_squash_START * (FF(1) - in.get(C::precomputed_first_row));
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 = in.get(C::public_data_squash_write_to_public_inputs) *
42 (FF(1) - in.get(C::public_data_squash_write_to_public_inputs));
43 tmp *= scaling_factor;
44 std::get<2>(evals) += typename Accumulator::View(tmp);
45 }
46 {
47 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
48 auto tmp = in.get(C::public_data_squash_leaf_slot_increase) *
49 (FF(1) - in.get(C::public_data_squash_leaf_slot_increase));
50 tmp *= scaling_factor;
51 std::get<3>(evals) += typename Accumulator::View(tmp);
52 }
53 { // CHECK_SAME_LEAF_SLOT
54 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
55 auto tmp = public_data_squash_NOT_END * (FF(1) - in.get(C::public_data_squash_leaf_slot_increase)) *
56 (in.get(C::public_data_squash_leaf_slot) - in.get(C::public_data_squash_leaf_slot_shift));
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::public_data_squash_check_clock) -
63 public_data_squash_NOT_END * (FF(1) - in.get(C::public_data_squash_leaf_slot_increase)));
64 tmp *= scaling_factor;
65 std::get<5>(evals) += typename Accumulator::View(tmp);
66 }
67 {
68 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
69 auto tmp = (in.get(C::public_data_squash_clk_diff) -
70 in.get(C::public_data_squash_check_clock) *
71 (in.get(C::public_data_squash_clk_shift) - in.get(C::public_data_squash_clk)));
72 tmp *= scaling_factor;
73 std::get<6>(evals) += typename Accumulator::View(tmp);
74 }
75 {
76 using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>;
77 auto tmp = in.get(C::public_data_squash_sel) * (FF(32) - in.get(C::public_data_squash_constant_32));
78 tmp *= scaling_factor;
79 std::get<7>(evals) += typename Accumulator::View(tmp);
80 }
81 {
82 using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>;
83 auto tmp = (in.get(C::public_data_squash_write_to_public_inputs_shift) -
84 (in.get(C::public_data_squash_leaf_slot_increase) + public_data_squash_START));
85 tmp *= scaling_factor;
86 std::get<8>(evals) += typename Accumulator::View(tmp);
87 }
88 { // FINAL_VALUE_PROPAGATION
89 using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>;
90 auto tmp = in.get(C::public_data_squash_check_clock) *
91 (in.get(C::public_data_squash_final_value) - in.get(C::public_data_squash_final_value_shift));
92 tmp *= scaling_factor;
93 std::get<9>(evals) += typename Accumulator::View(tmp);
94 }
95 { // FINAL_VALUE_CHECK
96 using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>;
97 auto tmp = public_data_squash_LEAF_SLOT_END *
98 (in.get(C::public_data_squash_final_value) - in.get(C::public_data_squash_value));
99 tmp *= scaling_factor;
100 std::get<10>(evals) += typename Accumulator::View(tmp);
101 }
102}
103
104} // 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.