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
8
9namespace bb::avm2::tracegen {
10
11template <typename LookupSettings> class LookupIntoPDecomposition : public IndexedLookupTraceBuilder<LookupSettings> {
12 protected:
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
RefTuple< LookupSettings::LOOKUP_TUPLE_SIZE > TupleType
typename IndexedLookupTraceBuilder< LookupSettings >::TupleType TupleType
uint32_t find_in_dst(const TupleType &tup) const override
size_t get_p_limbs_per_radix_size(size_t radix)
Definition to_radix.cpp:54