15template <u
int64_t bits_per_slice, u
int64_t num_rotated_output_bits>
21template <u
int64_t bits_per_slice, u
int64_t num_rotated_output_bits>
24 const uint64_t base = 1UL << bits_per_slice;
30 for (uint64_t i = 0; i < base; ++i) {
31 for (uint64_t j = 0; j < base; ++j) {
38 table.
get_values_from_key = &get_xor_rotate_values_from_key<bits_per_slice, num_rotated_output_bits>;
47template <u
int64_t bits_per_slice, u
int64_t num_rotated_output_bits>
53template <u
int64_t bits_per_slice, u
int64_t num_rotated_output_bits>
56 const uint64_t base = 1UL << bits_per_slice;
62 for (uint64_t i = 0; i < base; ++i) {
63 for (uint64_t j = 0; j < base; ++j) {
70 table.
get_values_from_key = &get_and_rotate_values_from_key<bits_per_slice, num_rotated_output_bits>;
82 ASSERT(uint_size == 8 || uint_size == 16 || uint_size == 32 || uint_size == 64,
83 "unsupported uint size for XOR table generation");
85 const size_t TABLE_BIT_SIZE = 6;
86 const size_t num_entries = uint_size / TABLE_BIT_SIZE;
87 const uint64_t base = 1 << TABLE_BIT_SIZE;
88 MultiTable table(base, base, base, num_entries);
91 for (
size_t i = 0; i < num_entries; ++i) {
98 const size_t LAST_TABLE_BIT_SIZE = uint_size - TABLE_BIT_SIZE * num_entries;
99 const size_t LAST_SLICE_SIZE = 1 << LAST_TABLE_BIT_SIZE;
101 if (uint_size == 8 || uint_size == 32) {
116 ASSERT(uint_size == 8 || uint_size == 16 || uint_size == 32 || uint_size == 64,
117 "unsupported uint size for AND table generation");
119 const size_t TABLE_BIT_SIZE = 6;
120 const size_t num_entries = uint_size / TABLE_BIT_SIZE;
121 const uint64_t base = 1 << TABLE_BIT_SIZE;
122 MultiTable table(base, base, base, num_entries);
125 for (
size_t i = 0; i < num_entries; ++i) {
132 const size_t LAST_TABLE_BIT_SIZE = uint_size - TABLE_BIT_SIZE * num_entries;
133 const size_t LAST_SLICE_SIZE = 1 << LAST_TABLE_BIT_SIZE;
135 if (uint_size == 8 || uint_size == 32) {
#define ASSERT(expression,...)
constexpr uint64_t rotate64(const uint64_t value, const uint64_t rotation)
BasicTable generate_xor_rotate_table(BasicTableId id, const size_t table_index)
BasicTable generate_and_rotate_table(BasicTableId id, const size_t table_index)
MultiTable get_uint_xor_table(const MultiTableId id)
std::array< bb::fr, 2 > get_and_rotate_values_from_key(const std::array< uint64_t, 2 > key)
std::array< bb::fr, 2 > get_xor_rotate_values_from_key(const std::array< uint64_t, 2 > key)
MultiTable get_uint_and_table(const MultiTableId id)
@ UINT_AND_SLICE_6_ROTATE_0
@ UINT_AND_SLICE_4_ROTATE_0
@ UINT_XOR_SLICE_4_ROTATE_0
@ UINT_XOR_SLICE_6_ROTATE_0
@ UINT_AND_SLICE_2_ROTATE_0
@ UINT_XOR_SLICE_2_ROTATE_0
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