61 static constexpr uint64_t
BASE = 11;
64 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
103 uint64_t accumulator = 0;
104 uint64_t input =
key[0];
105 uint64_t base_shift = 1;
109 accumulator += (bit * base_shift);
147 if (counts[i] ==
BASE - 1) {
156 uint64_t normalized_value = 0;
158 value += counts[i] * scaled_bases[i];
161 return {
value, normalized_value };
185 for (
size_t i = 0; i < table_size; ++i) {
186 table.
column_1.emplace_back(column_values[0]);
187 table.
column_2.emplace_back(column_values[1]);
244 constexpr size_t num_tables_per_multitable =
248 MultiTable table(column_multiplier, column_multiplier, 0, num_tables_per_multitable);
251 for (
size_t i = 0; i < num_tables_per_multitable; ++i) {
Generates plookup tables required for THETA round of Keccak hash function.
static MultiTable get_theta_output_table(const MultiTableId id=KECCAK_THETA_OUTPUT)
Create the THETA MultiTable used by plookup to generate a sequence of lookups.
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 BASE
static std::array< bb::fr, 2 > get_theta_renormalization_values(const std::array< uint64_t, 2 > key)
Given a table input value, return the table output value.
static constexpr size_t TABLE_BITS
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 THETA_NORMALIZATION_TABLE[11]
static BasicTable generate_theta_renormalization_table(BasicTableId id, const size_t table_index)
Generate plookup table that normalizes a TABLE_BITS-slice of a base-11 integer.
constexpr uint64_t pow64(const uint64_t input, const uint64_t exponent)
field< Bn254FrParams > fr
C slice(C const &container, size_t start)
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