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
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void public_data_squashImpl<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 public_data_squash_START =
19 in.get(C::public_data_squash_sel_shift) * (FF(1) - in.get(C::public_data_squash_sel));
20 const auto public_data_squash_END =
21 in.get(C::public_data_squash_sel) * (FF(1) - in.get(C::public_data_squash_sel_shift));
22 const auto public_data_squash_NOT_END = in.get(C::public_data_squash_sel) * in.get(C::public_data_squash_sel_shift);
23 const auto public_data_squash_CLK_DIFF =
24 in.get(C::public_data_squash_check_clock) *
25 (in.get(C::public_data_squash_clk_shift) - in.get(C::public_data_squash_clk));
26 const auto public_data_squash_LEAF_SLOT_END =
27 in.get(C::public_data_squash_leaf_slot_increase) + public_data_squash_END;
28
29 {
30 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
31 auto tmp = static_cast<View>(in.get(C::public_data_squash_sel)) *
32 (FF(1) - static_cast<View>(in.get(C::public_data_squash_sel)));
33 std::get<0>(evals) += (tmp * scaling_factor);
34 }
35 { // START_CONDITION
36 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
37 auto tmp = CView(public_data_squash_START) * (FF(1) - static_cast<View>(in.get(C::precomputed_first_row)));
38 std::get<1>(evals) += (tmp * scaling_factor);
39 }
40 {
41 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
42 auto tmp = static_cast<View>(in.get(C::public_data_squash_write_to_public_inputs)) *
43 (FF(1) - static_cast<View>(in.get(C::public_data_squash_write_to_public_inputs)));
44 std::get<2>(evals) += (tmp * scaling_factor);
45 }
46 {
47 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
48 auto tmp = static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase)) *
49 (FF(1) - static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase)));
50 std::get<3>(evals) += (tmp * scaling_factor);
51 }
52 { // CHECK_SAME_LEAF_SLOT
53 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
54 auto tmp = CView(public_data_squash_NOT_END) *
55 (FF(1) - static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase))) *
56 (static_cast<View>(in.get(C::public_data_squash_leaf_slot)) -
57 static_cast<View>(in.get(C::public_data_squash_leaf_slot_shift)));
58 std::get<4>(evals) += (tmp * scaling_factor);
59 }
60 {
61 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
62 auto tmp = (static_cast<View>(in.get(C::public_data_squash_check_clock)) -
63 CView(public_data_squash_NOT_END) *
64 (FF(1) - static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase))));
65 std::get<5>(evals) += (tmp * scaling_factor);
66 }
67 { // CLK_DIFF_DECOMP
68 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
69 auto tmp = (CView(public_data_squash_CLK_DIFF) -
70 (static_cast<View>(in.get(C::public_data_squash_clk_diff_lo)) +
71 FF(65536) * static_cast<View>(in.get(C::public_data_squash_clk_diff_hi))));
72 std::get<6>(evals) += (tmp * scaling_factor);
73 }
74 {
75 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
76 auto tmp =
77 (static_cast<View>(in.get(C::public_data_squash_write_to_public_inputs_shift)) -
78 (static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase)) + CView(public_data_squash_START)));
79 std::get<7>(evals) += (tmp * scaling_factor);
80 }
81 { // FINAL_VALUE_PROPAGATION
82 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
83 auto tmp = static_cast<View>(in.get(C::public_data_squash_check_clock)) *
84 (static_cast<View>(in.get(C::public_data_squash_final_value)) -
85 static_cast<View>(in.get(C::public_data_squash_final_value_shift)));
86 std::get<8>(evals) += (tmp * scaling_factor);
87 }
88 { // FINAL_VALUE_CHECK
89 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
90 auto tmp =
91 CView(public_data_squash_LEAF_SLOT_END) * (static_cast<View>(in.get(C::public_data_squash_final_value)) -
92 static_cast<View>(in.get(C::public_data_squash_value)));
93 std::get<9>(evals) += (tmp * scaling_factor);
94 }
95}
96
97} // 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.