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
5
6namespace bb::avm2 {
7
8template <typename FF_>
9template <typename ContainerOverSubrelations, typename AllEntities>
10void l1_to_l2_message_tree_checkImpl<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/l1_to_l2_message_tree_check");
18
19 const auto constants_L1_TO_L2_MSG_TREE_HEIGHT = FF(39);
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 Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
25 auto tmp = in.get(C::l1_to_l2_message_tree_check_sel) * (FF(1) - in.get(C::l1_to_l2_message_tree_check_sel));
26 tmp *= scaling_factor;
27 std::get<0>(evals) += typename Accumulator::View(tmp);
28 }
29 {
30 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
31 auto tmp = in.get(C::l1_to_l2_message_tree_check_sel) *
32 ((l1_to_l2_message_tree_check_LEAF_VALUE_MSG_HASH_DIFF *
33 (in.get(C::l1_to_l2_message_tree_check_exists) *
34 (FF(1) - in.get(C::l1_to_l2_message_tree_check_leaf_value_msg_hash_diff_inv)) +
35 in.get(C::l1_to_l2_message_tree_check_leaf_value_msg_hash_diff_inv)) -
36 FF(1)) +
37 in.get(C::l1_to_l2_message_tree_check_exists));
38 tmp *= scaling_factor;
39 std::get<1>(evals) += typename Accumulator::View(tmp);
40 }
41 {
42 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
43 auto tmp =
44 in.get(C::l1_to_l2_message_tree_check_sel) *
45 (constants_L1_TO_L2_MSG_TREE_HEIGHT - in.get(C::l1_to_l2_message_tree_check_l1_to_l2_message_tree_height));
46 tmp *= scaling_factor;
47 std::get<2>(evals) += typename Accumulator::View(tmp);
48 }
49}
50
51} // 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.