Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
l1_to_l2_message_exists_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_existsImpl<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_LEAF_COUNT = FF(68719476736UL);
19 const auto constants_MEM_TAG_U1 = FF(1);
20
21 {
22 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
23 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_l1_to_l2_message_exists)) *
24 (static_cast<View>(in.get(C::execution_l1_to_l2_msg_tree_leaf_count)) -
25 CView(constants_L1_TO_L2_MSG_TREE_LEAF_COUNT));
26 std::get<0>(evals) += (tmp * scaling_factor);
27 }
28 { // L1_TO_L2_MSG_EXISTS_OUT_OF_RANGE_FALSE
29 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
30 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_l1_to_l2_message_exists)) *
31 (FF(1) - static_cast<View>(in.get(C::execution_l1_to_l2_msg_leaf_in_range))) *
32 static_cast<View>(in.get(C::execution_register_2_));
33 std::get<1>(evals) += (tmp * scaling_factor);
34 }
35 { // L1_TO_L2_MSG_EXISTS_U1_OUTPUT_TAG
36 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
37 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_l1_to_l2_message_exists)) *
38 (CView(constants_MEM_TAG_U1) - static_cast<View>(in.get(C::execution_mem_tag_reg_2_)));
39 std::get<2>(evals) += (tmp * scaling_factor);
40 }
41 { // L1_TO_L2_MSG_EXISTS_SUCCESS
42 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
43 auto tmp = static_cast<View>(in.get(C::execution_sel_execute_l1_to_l2_message_exists)) *
44 static_cast<View>(in.get(C::execution_sel_opcode_error));
45 std::get<3>(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.