Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
l1_to_l2_message_tree_check_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 l1_to_l2_message_tree_checkImpl<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_L1_TO_L2_MSG_TREE_HEIGHT = FF(36);
19 const auto l1_to_l2_message_tree_check_LEAF_VALUE_MSG_HASH_DIFF =
20 (in.get(C::l1_to_l2_message_tree_check_leaf_value) - in.get(C::l1_to_l2_message_tree_check_msg_hash));
21
22 {
23 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
24 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)) *
25 (FF(1) - static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)));
26 std::get<0>(evals) += (tmp * scaling_factor);
27 }
28 {
29 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
30 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)) *
31 ((CView(l1_to_l2_message_tree_check_LEAF_VALUE_MSG_HASH_DIFF) *
32 (static_cast<View>(in.get(C::l1_to_l2_message_tree_check_exists)) *
33 (FF(1) -
34 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_leaf_value_msg_hash_diff_inv))) +
35 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_leaf_value_msg_hash_diff_inv))) -
36 FF(1)) +
37 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_exists)));
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::l1_to_l2_message_tree_check_sel)) *
43 (CView(constants_L1_TO_L2_MSG_TREE_HEIGHT) -
44 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_l1_to_l2_message_tree_height)));
45 std::get<2>(evals) += (tmp * scaling_factor);
46 }
47}
48
49} // 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.