Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
calldata_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 calldataImpl<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/calldata");
18
19 const auto calldata_FIRST_OR_LAST_CALLDATA = in.get(C::precomputed_first_row) + in.get(C::calldata_latch);
20
21 {
22 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
23 auto tmp = in.get(C::calldata_sel) * (FF(1) - calldata_FIRST_OR_LAST_CALLDATA) *
24 ((in.get(C::calldata_index_shift) - in.get(C::calldata_index)) - FF(1));
25 tmp *= scaling_factor;
26 std::get<0>(evals) += typename Accumulator::View(tmp);
27 }
28 { // TRACE_CONTINUITY
29 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
30 auto tmp = (FF(1) - in.get(C::precomputed_first_row)) * (FF(1) - in.get(C::calldata_sel)) *
31 in.get(C::calldata_sel_shift);
32 tmp *= scaling_factor;
33 std::get<1>(evals) += typename Accumulator::View(tmp);
34 }
35 { // CONTEXT_ID_CONTINUITY
36 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
37 auto tmp = (FF(1) - in.get(C::precomputed_first_row)) * in.get(C::calldata_sel) *
38 (FF(1) - in.get(C::calldata_latch)) *
39 (in.get(C::calldata_context_id) - in.get(C::calldata_context_id_shift));
40 tmp *= scaling_factor;
41 std::get<2>(evals) += typename Accumulator::View(tmp);
42 }
43}
44
45} // 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.