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
6
7namespace bb::avm2::tracegen {
8
9template <typename LookupSettings> class LookupIntoBitwise : public IndexedLookupTraceBuilder<LookupSettings> {
10 protected:
11 // This is an efficient implementation of indexing into the precomputed table.
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
uint32_t find_in_dst(const std::array< FF, LookupSettings::LOOKUP_TUPLE_SIZE > &tup) const override
FF a
FF b
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13