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_END =
19 in.get(C::public_data_squash_sel) * (FF(1) - in.get(C::public_data_squash_sel_shift));
20 const auto public_data_squash_NOT_END = in.get(C::public_data_squash_sel) * in.get(C::public_data_squash_sel_shift);
21 const auto public_data_squash_CLK_DIFF =
22 in.get(C::public_data_squash_check_clock) *
23 ((in.get(C::public_data_squash_clk_shift) - in.get(C::public_data_squash_clk)) - FF(1));
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 View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
29 auto tmp = static_cast<View>(in.get(C::public_data_squash_sel)) *
30 (FF(1) - static_cast<View>(in.get(C::public_data_squash_sel)));
31 std::get<0>(evals) += (tmp * scaling_factor);
32 }
33 { // TRACE_CONTINUITY
34 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
35 auto tmp = ((FF(1) - static_cast<View>(in.get(C::public_data_squash_sel))) -
36 static_cast<View>(in.get(C::precomputed_first_row))) *
37 static_cast<View>(in.get(C::public_data_squash_sel_shift));
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 {
53 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
54 auto tmp = CView(public_data_squash_END) * static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase));
55 std::get<4>(evals) += (tmp * scaling_factor);
56 }
57 { // CHECK_CLOCK_CONDITION
58 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
59 auto tmp = (static_cast<View>(in.get(C::public_data_squash_check_clock)) -
60 CView(public_data_squash_NOT_END) *
61 (FF(1) - static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase))));
62 std::get<5>(evals) += (tmp * scaling_factor);
63 }
64 { // CHECK_SAME_LEAF_SLOT
65 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
66 auto tmp = static_cast<View>(in.get(C::public_data_squash_check_clock)) *
67 (static_cast<View>(in.get(C::public_data_squash_leaf_slot)) -
68 static_cast<View>(in.get(C::public_data_squash_leaf_slot_shift)));
69 std::get<6>(evals) += (tmp * scaling_factor);
70 }
71 { // CLK_DIFF_DECOMP
72 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
73 auto tmp = (CView(public_data_squash_CLK_DIFF) -
74 (static_cast<View>(in.get(C::public_data_squash_clk_diff_lo)) +
75 FF(65536) * static_cast<View>(in.get(C::public_data_squash_clk_diff_hi))));
76 std::get<7>(evals) += (tmp * scaling_factor);
77 }
78 {
79 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
80 auto tmp = (static_cast<View>(in.get(C::public_data_squash_write_to_public_inputs_shift)) -
81 (static_cast<View>(in.get(C::public_data_squash_leaf_slot_increase)) +
82 static_cast<View>(in.get(C::public_data_squash_sel_shift)) *
83 (FF(1) - static_cast<View>(in.get(C::public_data_squash_sel)))));
84 std::get<8>(evals) += (tmp * scaling_factor);
85 }
86 { // FINAL_VALUE_PROPAGATION
87 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
88 auto tmp = static_cast<View>(in.get(C::public_data_squash_check_clock)) *
89 (static_cast<View>(in.get(C::public_data_squash_final_value)) -
90 static_cast<View>(in.get(C::public_data_squash_final_value_shift)));
91 std::get<9>(evals) += (tmp * scaling_factor);
92 }
93 { // FINAL_VALUE_CHECK
94 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
95 auto tmp =
96 CView(public_data_squash_LEAF_SLOT_END) * (static_cast<View>(in.get(C::public_data_squash_final_value)) -
97 static_cast<View>(in.get(C::public_data_squash_value)));
98 std::get<10>(evals) += (tmp * scaling_factor);
99 }
100}
101
102} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:34
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.