Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
external_call_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 external_callImpl<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 {
19 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
20 auto tmp = (static_cast<View>(in.get(C::execution_l2_gas_left)) -
21 static_cast<View>(in.get(C::execution_sel_enter_call)) *
22 (static_cast<View>(in.get(C::execution_l2_gas_limit)) -
23 static_cast<View>(in.get(C::execution_l2_gas_used))));
24 std::get<0>(evals) += (tmp * scaling_factor);
25 }
26 {
27 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
28 auto tmp = (static_cast<View>(in.get(C::execution_da_gas_left)) -
29 static_cast<View>(in.get(C::execution_sel_enter_call)) *
30 (static_cast<View>(in.get(C::execution_da_gas_limit)) -
31 static_cast<View>(in.get(C::execution_da_gas_used))));
32 std::get<1>(evals) += (tmp * scaling_factor);
33 }
34 {
35 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
36 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
37 (((static_cast<View>(in.get(C::execution_register_0_)) -
38 static_cast<View>(in.get(C::execution_l2_gas_left))) *
39 static_cast<View>(in.get(C::execution_call_is_l2_gas_allocated_lt_left)) +
40 static_cast<View>(in.get(C::execution_l2_gas_left))) -
41 static_cast<View>(in.get(C::execution_l2_gas_limit_shift)));
42 std::get<2>(evals) += (tmp * scaling_factor);
43 }
44 {
45 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
46 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
47 (((static_cast<View>(in.get(C::execution_register_1_)) -
48 static_cast<View>(in.get(C::execution_da_gas_left))) *
49 static_cast<View>(in.get(C::execution_call_is_da_gas_allocated_lt_left)) +
50 static_cast<View>(in.get(C::execution_da_gas_left))) -
51 static_cast<View>(in.get(C::execution_da_gas_limit_shift)));
52 std::get<3>(evals) += (tmp * scaling_factor);
53 }
54}
55
56} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:34
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Container for parameters used by the grand product (permutation, lookup) Honk relations.