Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
lookup_into_bitwise.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cassert>
4
5
#include "
barretenberg/vm2/tracegen/lib/lookup_builder.hpp
"
6
7
namespace
bb::avm2::tracegen
{
8
9
template
<
typename
LookupSettings>
class
LookupIntoBitwise
:
public
IndexedLookupTraceBuilder
<LookupSettings> {
10
protected
:
11
// This is an efficient implementation of indexing into the precomputed table.
12
uint32_t
find_in_dst
(
const
std::array<FF, LookupSettings::LOOKUP_TUPLE_SIZE>
& tup)
const override
13
{
14
// row # is derived as:
15
// - input_b: bits 0...7 (0 being LSB)
16
// - input_a: bits 8...15
17
// - op_id: bits 16...
18
// In other words, the first 256*256 rows are for op_id 0. Next are for op_id 1, followed by op_id 2.
19
const
auto
& [op_id,
a
,
b
, _] = tup;
20
return
(
static_cast<
uint32_t
>
(op_id) <<
static_cast<
uint32_t
>
(16)) | (
static_cast<
uint32_t
>
(
a
) << 8) |
21
static_cast<
uint32_t
>
(
b
);
22
}
23
};
24
25
}
// namespace bb::avm2::tracegen
bb::avm2::tracegen::IndexedLookupTraceBuilder
Definition
lookup_builder.hpp:20
bb::avm2::tracegen::LookupIntoBitwise
Definition
lookup_into_bitwise.hpp:9
bb::avm2::tracegen::LookupIntoBitwise::find_in_dst
uint32_t find_in_dst(const std::array< FF, LookupSettings::LOOKUP_TUPLE_SIZE > &tup) const override
Definition
lookup_into_bitwise.hpp:12
a
FF a
Definition
field_gt.test.cpp:51
b
FF b
Definition
field_gt.test.cpp:52
lookup_builder.hpp
bb::avm2::tracegen
Definition
full_row.hpp:10
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
src
barretenberg
vm2
tracegen
lib
lookup_into_bitwise.hpp
Generated by
1.9.8