13#include "../sparse.hpp"
14#include "../types.hpp"
25 static constexpr uint64_t
BASE = 11;
79 uint64_t normalized_value = 0;
81 value += counts[i] * scaled_bases[i];
84 return {
value, normalized_value };
105 for (
size_t i = 0; i < table_size; ++i) {
106 table.
column_1.emplace_back(column_values[0]);
107 table.
column_2.emplace_back(column_values[1]);
112 table.
get_values_from_key = &sparse_tables::get_sparse_normalization_values<BASE, OUTPUT_NORMALIZATION_TABLE>;
162 constexpr size_t num_tables_per_multitable =
169 for (
size_t i = 0; i < num_tables_per_multitable; ++i) {
173 &sparse_tables::get_sparse_normalization_values<BASE, OUTPUT_NORMALIZATION_TABLE>);
Converts a base-11 sparse integer representation into a regular base-2 binary integer....
static constexpr uint64_t OUTPUT_NORMALIZATION_TABLE[2]
static constexpr size_t TABLE_BITS
static std::array< uint64_t, 2 > get_column_values_for_next_row(std::array< size_t, TABLE_BITS > &counts)
Get column values for next row of plookup table. Used to generate plookup table row values.
static constexpr uint64_t EFFECTIVE_BASE
static constexpr std::array< uint64_t, TABLE_BITS > get_scaled_bases()
Precompute an array of base multipliers (11^i for i = [0, ..., TABLE_BITS - 1]) Code is slightly fast...
static constexpr uint64_t BASE
static MultiTable get_keccak_output_table(const MultiTableId id=KECCAK_FORMAT_OUTPUT)
Create the KeccakOutput MultiTable used by plookup to generate a sequence of lookups.
static BasicTable generate_keccak_output_table(BasicTableId id, const size_t table_index)
Generate plookup table that maps a TABLE_BITS-slice of a base-11 integer into a base-2 integer.
constexpr uint64_t pow64(const uint64_t input, const uint64_t exponent)
field< Bn254FrParams > fr
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
A basic table from which we can perform lookups (for example, an xor table)
bb::fr column_2_step_size
bb::fr column_1_step_size
std::vector< bb::fr > column_3
std::vector< bb::fr > column_2
std::array< bb::fr, 2 >(* get_values_from_key)(const std::array< uint64_t, 2 >)
std::vector< bb::fr > column_1
bb::fr column_3_step_size
Container for managing multiple BasicTables plus the data needed to combine basic table outputs (e....
std::vector< BasicTableId > basic_table_ids
std::vector< uint64_t > slice_sizes
std::vector< table_out(*)(table_in)> get_table_values