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 constants_DOM_SEP__MERKLE_HASH = FF(2982624097UL);
20 const auto l1_to_l2_message_tree_check_LEAF_VALUE_MSG_HASH_DIFF =
21 (in.get(C::l1_to_l2_message_tree_check_leaf_value) - in.get(C::l1_to_l2_message_tree_check_msg_hash));
22
23 {
24 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
25 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)) *
26 (FF(1) - static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)));
27 std::get<0>(evals) += (tmp * scaling_factor);
28 }
29 {
30 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
31 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_exists)) *
32 (FF(1) - static_cast<View>(in.get(C::l1_to_l2_message_tree_check_exists)));
33 std::get<1>(evals) += (tmp * scaling_factor);
34 }
35 {
36 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
37 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)) *
38 ((CView(l1_to_l2_message_tree_check_LEAF_VALUE_MSG_HASH_DIFF) *
39 (static_cast<View>(in.get(C::l1_to_l2_message_tree_check_exists)) *
40 (FF(1) -
41 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_leaf_value_msg_hash_diff_inv))) +
42 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_leaf_value_msg_hash_diff_inv))) -
43 FF(1)) +
44 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_exists)));
45 std::get<2>(evals) += (tmp * scaling_factor);
46 }
47 {
48 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
49 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)) *
50 (CView(constants_L1_TO_L2_MSG_TREE_HEIGHT) -
51 static_cast<View>(in.get(C::l1_to_l2_message_tree_check_l1_to_l2_message_tree_height)));
52 std::get<3>(evals) += (tmp * scaling_factor);
53 }
54 { // MERKLE_HASH_SEPARATOR_CONSTANT
55 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
56 auto tmp = static_cast<View>(in.get(C::l1_to_l2_message_tree_check_sel)) *
57 (static_cast<View>(in.get(C::l1_to_l2_message_tree_check_merkle_hash_separator)) -
58 CView(constants_DOM_SEP__MERKLE_HASH));
59 std::get<4>(evals) += (tmp * scaling_factor);
60 }
61}
62
63} // 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.