Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
lookup_into_p_decomposition.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cassert>
4
#include <cstdint>
5
6
#include "
barretenberg/vm2/common/to_radix.hpp
"
7
#include "
barretenberg/vm2/tracegen/lib/lookup_builder.hpp
"
8
9
namespace
bb::avm2::tracegen
{
10
11
template
<
typename
LookupSettings>
class
LookupIntoPDecomposition
:
public
IndexedLookupTraceBuilder
<LookupSettings> {
12
protected
:
13
using
TupleType
=
typename
IndexedLookupTraceBuilder<LookupSettings>::TupleType
;
14
uint32_t
find_in_dst
(
const
TupleType
& tup)
const override
15
{
16
const
auto
& [radix, limb_index, _] = tup;
17
size_t
radix_index =
static_cast<
size_t
>
(uint64_t(radix));
18
uint32_t row = 0;
19
for
(
size_t
i = 0; i < radix_index; ++i) {
20
row +=
static_cast<
uint32_t
>
(
get_p_limbs_per_radix_size
(i));
21
}
22
23
row +=
static_cast<
uint32_t
>
(limb_index);
24
25
return
row;
26
}
27
};
28
29
}
// namespace bb::avm2::tracegen
bb::avm2::tracegen::IndexedLookupTraceBuilder
Definition
lookup_builder.hpp:24
bb::avm2::tracegen::IndexedLookupTraceBuilder::TupleType
RefTuple< LookupSettings::LOOKUP_TUPLE_SIZE > TupleType
Definition
lookup_builder.hpp:64
bb::avm2::tracegen::LookupIntoPDecomposition
Definition
lookup_into_p_decomposition.hpp:11
bb::avm2::tracegen::LookupIntoPDecomposition::TupleType
typename IndexedLookupTraceBuilder< LookupSettings >::TupleType TupleType
Definition
lookup_into_p_decomposition.hpp:13
bb::avm2::tracegen::LookupIntoPDecomposition::find_in_dst
uint32_t find_in_dst(const TupleType &tup) const override
Definition
lookup_into_p_decomposition.hpp:14
to_radix.hpp
lookup_builder.hpp
bb::avm2::tracegen
Definition
full_row.hpp:9
bb::avm2::get_p_limbs_per_radix_size
size_t get_p_limbs_per_radix_size(size_t radix)
Definition
to_radix.cpp:54
src
barretenberg
vm2
tracegen
lib
lookup_into_p_decomposition.hpp
Generated by
1.9.8