4#include "barretenberg/common/constexpr_utils.hpp"
5#include "barretenberg/numeric/bitop/pow.hpp"
6#include "barretenberg/numeric/bitop/sparse_form.hpp"
9namespace keccak_tables {
29 static constexpr uint64_t BASE = 11;
30 static constexpr size_t TABLE_BITS = 8;
42 const uint256_t t0 = numeric::map_into_sparse_form<BASE>(key[0]);
44 constexpr size_t msb_shift = (64 % TABLE_BITS == 0) ? TABLE_BITS - 1 : (64 % TABLE_BITS) - 1;
60 table.table_index = table_index;
61 table.size = (1U << TABLE_BITS);
62 table.use_twin_keys =
false;
63 constexpr size_t msb_shift = (64 % TABLE_BITS == 0) ? TABLE_BITS - 1 : (64 % TABLE_BITS) - 1;
65 for (uint64_t i = 0; i < table.size; ++i) {
66 const uint64_t source = i;
67 const auto target = numeric::map_into_sparse_form<BASE>(source);
76 for (
size_t i = 0; i < TABLE_BITS; ++i) {
77 sparse_step_size *= BASE;
129 const size_t num_entries = 8;
134 for (
size_t i = 0; i < num_entries; ++i) {
135 table.slice_sizes.emplace_back(1 << 8);
136 table.lookup_ids.emplace_back(KECCAK_INPUT);
Definition: uint256.hpp:25
The structure contains the most basic table serving one function (for, example an xor table)
Definition: types.hpp:263
Definition: types.hpp:124