Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bc_hashing_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 bc_hashingImpl<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/bc_hashing");
18
19 const auto bc_hashing_LATCH_CONDITION = in.get(C::bc_hashing_latch) + in.get(C::precomputed_first_row);
20
21 {
22 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
23 auto tmp = in.get(C::bc_hashing_sel) * (FF(1) - in.get(C::bc_hashing_sel));
24 tmp *= scaling_factor;
25 std::get<0>(evals) += typename Accumulator::View(tmp);
26 }
27 { // TRACE_CONTINUITY
28 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
29 auto tmp = (FF(1) - in.get(C::precomputed_first_row)) * (FF(1) - in.get(C::bc_hashing_sel)) *
30 in.get(C::bc_hashing_sel_shift);
31 tmp *= scaling_factor;
32 std::get<1>(evals) += typename Accumulator::View(tmp);
33 }
34 {
35 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
36 auto tmp = in.get(C::bc_hashing_latch) * (FF(1) - in.get(C::bc_hashing_latch));
37 tmp *= scaling_factor;
38 std::get<2>(evals) += typename Accumulator::View(tmp);
39 }
40 { // SEL_TOGGLED_AT_LATCH
41 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
42 auto tmp = in.get(C::bc_hashing_latch) * (FF(1) - in.get(C::bc_hashing_sel));
43 tmp *= scaling_factor;
44 std::get<3>(evals) += typename Accumulator::View(tmp);
45 }
46 {
47 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
48 auto tmp = in.get(C::bc_hashing_start) * (FF(1) - in.get(C::bc_hashing_start));
49 tmp *= scaling_factor;
50 std::get<4>(evals) += typename Accumulator::View(tmp);
51 }
52 { // START_AFTER_LATCH
53 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
54 auto tmp = in.get(C::bc_hashing_sel_shift) * (in.get(C::bc_hashing_start_shift) - bc_hashing_LATCH_CONDITION);
55 tmp *= scaling_factor;
56 std::get<5>(evals) += typename Accumulator::View(tmp);
57 }
58 { // PC_INCREMENTS
59 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
60 auto tmp = in.get(C::bc_hashing_sel) *
61 (in.get(C::bc_hashing_pc_index_shift) -
62 (FF(1) - bc_hashing_LATCH_CONDITION) * (FF(31) + in.get(C::bc_hashing_pc_index)));
63 tmp *= scaling_factor;
64 std::get<6>(evals) += typename Accumulator::View(tmp);
65 }
66 { // ID_CONSISTENCY
67 using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>;
68 auto tmp = (FF(1) - bc_hashing_LATCH_CONDITION) *
69 (in.get(C::bc_hashing_bytecode_id_shift) - in.get(C::bc_hashing_bytecode_id));
70 tmp *= scaling_factor;
71 std::get<7>(evals) += typename Accumulator::View(tmp);
72 }
73 { // CHAIN_OUTPUT_TO_INCR
74 using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>;
75 auto tmp = (FF(1) - bc_hashing_LATCH_CONDITION) *
76 (in.get(C::bc_hashing_incremental_hash_shift) - in.get(C::bc_hashing_output_hash));
77 tmp *= scaling_factor;
78 std::get<8>(evals) += typename Accumulator::View(tmp);
79 }
80}
81
82} // 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.