Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
notehash_exists_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 notehash_existsImpl<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/notehash_exists");
18
19 const auto constants_NOTE_HASH_TREE_LEAF_COUNT = FF(1099511627776UL);
20 const auto constants_MEM_TAG_U1 = FF(1);
21
22 {
23 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
24 auto tmp =
25 in.get(C::execution_note_hash_leaf_in_range) * (FF(1) - in.get(C::execution_note_hash_leaf_in_range));
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::execution_sel_execute_notehash_exists) *
32 (in.get(C::execution_note_hash_tree_leaf_count) - constants_NOTE_HASH_TREE_LEAF_COUNT);
33 tmp *= scaling_factor;
34 std::get<1>(evals) += typename Accumulator::View(tmp);
35 }
36 { // NOTE_HASH_EXISTS_OUT_OF_RANGE_FALSE
37 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
38 auto tmp = in.get(C::execution_sel_execute_notehash_exists) *
39 (FF(1) - in.get(C::execution_note_hash_leaf_in_range)) * in.get(C::execution_register_2_);
40 tmp *= scaling_factor;
41 std::get<2>(evals) += typename Accumulator::View(tmp);
42 }
43 { // NOTEHASH_EXISTS_U1_OUTPUT_TAG
44 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
45 auto tmp = in.get(C::execution_sel_execute_notehash_exists) *
46 (constants_MEM_TAG_U1 - in.get(C::execution_mem_tag_reg_2_));
47 tmp *= scaling_factor;
48 std::get<3>(evals) += typename Accumulator::View(tmp);
49 }
50 { // NOTE_HASH_EXISTS_SUCCESS
51 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
52 auto tmp = in.get(C::execution_sel_execute_notehash_exists) * in.get(C::execution_sel_opcode_error);
53 tmp *= scaling_factor;
54 std::get<4>(evals) += typename Accumulator::View(tmp);
55 }
56}
57
58} // 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.