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 <cstdint>
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
public
:
11
// Inherit the base constructors (incl. the outer_dst_selector one) so the interaction can be registered
12
// with an explicit outer selector (precomputed.sel_range_16); the base process() then toggles the
13
// fine-grained DST_SELECTOR (precomputed.sel_bitwise) only on the rows actually read.
14
using
IndexedLookupTraceBuilder
<
LookupSettings
>
::IndexedLookupTraceBuilder
;
15
16
protected
:
17
using
TupleType
=
typename
IndexedLookupTraceBuilder<LookupSettings>::TupleType
;
18
// This is an efficient implementation of indexing into the precomputed table.
19
uint32_t
find_in_dst
(
const
TupleType
& tup)
const override
20
{
21
// row # is derived as:
22
// - input_b: bits 0...7 (0 being LSB)
23
// - input_a: bits 8...15
24
const
auto
& [
a
,
b
, c_and, c_or, c_xor] = tup;
25
return
(
static_cast<
uint32_t
>
(
a
) << 8) |
static_cast<
uint32_t
>
(
b
);
26
}
27
};
28
29
}
// namespace bb::avm2::tracegen
bb::avm2::tracegen::IndexedLookupTraceBuilder
Definition
lookup_builder.hpp:21
bb::avm2::tracegen::IndexedLookupTraceBuilder< LookupSettings >::LookupSettings
LookupSettings LookupSettings
Definition
lookup_builder.hpp:62
bb::avm2::tracegen::IndexedLookupTraceBuilder::TupleType
RefTuple< LookupSettings::LOOKUP_TUPLE_SIZE > TupleType
Definition
lookup_builder.hpp:63
bb::avm2::tracegen::IndexedLookupTraceBuilder< LookupSettings >::IndexedLookupTraceBuilder
IndexedLookupTraceBuilder()
Definition
lookup_builder.hpp:23
bb::avm2::tracegen::LookupIntoBitwise
Definition
lookup_into_bitwise.hpp:9
bb::avm2::tracegen::LookupIntoBitwise::TupleType
typename IndexedLookupTraceBuilder< LookupSettings >::TupleType TupleType
Definition
lookup_into_bitwise.hpp:17
bb::avm2::tracegen::LookupIntoBitwise::find_in_dst
uint32_t find_in_dst(const TupleType &tup) const override
Definition
lookup_into_bitwise.hpp:19
a
FF a
Definition
field_gt.test.cpp:52
b
FF b
Definition
field_gt.test.cpp:53
lookup_builder.hpp
bb::avm2::tracegen
Definition
full_row.hpp:10
src
barretenberg
vm2
tracegen
lib
lookup_into_bitwise.hpp
Generated by
1.9.8