19static constexpr uint64_t choose_normalization_table[28]{
54static constexpr uint64_t majority_normalization_table[16]{
77static constexpr uint64_t witness_extension_normalization_table[16]{
102 return sparse_tables::generate_sparse_normalization_table<16, 3, witness_extension_normalization_table>(
108 return sparse_tables::generate_sparse_normalization_table<28, 2, choose_normalization_table>(
id, table_index);
113 return sparse_tables::generate_sparse_normalization_table<16, 3, majority_normalization_table>(
id, table_index);
118 const size_t num_entries = 11;
123 for (
size_t i = 0; i < num_entries; ++i) {
127 &sparse_tables::get_sparse_normalization_values<16, witness_extension_normalization_table>);
134 const size_t num_entries = 16;
139 for (
size_t i = 0; i < num_entries; ++i) {
143 &sparse_tables::get_sparse_normalization_values<28, choose_normalization_table>);
150 const size_t num_entries = 11;
155 for (
size_t i = 0; i < num_entries; ++i) {
159 &sparse_tables::get_sparse_normalization_values<16, majority_normalization_table>);
166 constexpr uint64_t base_temp = 16;
167 auto base =
bb::fr(base_temp);
175 rot2_coefficients[0] + rot13_coefficients[0] + rot22_coefficients[0],
176 rot2_coefficients[1] + rot13_coefficients[1] + rot22_coefficients[1],
177 rot2_coefficients[2] + rot13_coefficients[2] + rot22_coefficients[2],
180 bb::fr column_2_row_1_multiplier = target_rotation_coefficients[0];
181 bb::fr column_2_row_2_multiplier =
182 target_rotation_coefficients[0] * (-
bb::fr(base).
pow(11)) + target_rotation_coefficients[1];
185 return rotation_multipliers;
204 rot6_coefficients[0] + rot11_coefficients[0] + rot25_coefficients[0],
205 rot6_coefficients[1] + rot11_coefficients[1] + rot25_coefficients[1],
206 rot6_coefficients[2] + rot11_coefficients[2] + rot25_coefficients[2],
209 bb::fr column_2_row_1_multiplier =
bb::fr(1) * target_rotation_coefficients[0];
213 column_2_row_3_coefficients[0] * column_2_row_1_multiplier,
214 column_2_row_3_coefficients[1] * column_2_row_1_multiplier,
215 column_2_row_3_coefficients[2] * column_2_row_1_multiplier,
218 bb::fr column_2_row_3_multiplier = -(current_coefficients[2]) + target_rotation_coefficients[2];
221 return rotation_multipliers;
229 MultiTable table(column_1_coefficients, column_2_coefficients, column_3_coefficients);
231 table.
slice_sizes = { (1 << 3), (1 << 7), (1 << 8), (1 << 18) };
238 &sparse_tables::get_sparse_table_with_rotation_values<16, 0>,
239 &sparse_tables::get_sparse_table_with_rotation_values<16, 4>,
240 &sparse_tables::get_sparse_table_with_rotation_values<16, 7>,
241 &sparse_tables::get_sparse_table_with_rotation_values<16, 1>,
307 rot6_coefficients[0] + rot11_coefficients[0] + rot25_coefficients[0],
308 rot6_coefficients[1] + rot11_coefficients[1] + rot25_coefficients[1],
309 rot6_coefficients[2] + rot11_coefficients[2] + rot25_coefficients[2],
312 bb::fr column_2_row_1_multiplier = target_rotation_coefficients[0];
316 column_2_row_1_multiplier,
317 bb::fr(28).
pow(11) * column_2_row_1_multiplier,
318 bb::fr(28).
pow(22) * column_2_row_1_multiplier,
322 bb::fr column_3_row_2_multiplier = -(current_coefficients[1]) + target_rotation_coefficients[1];
327 MultiTable table(column_1_coefficients, column_2_coefficients, column_3_coefficients);
329 table.
slice_sizes = { (1 << 11), (1 << 11), (1 << 10) };
332 table.
get_table_values.push_back(&sparse_tables::get_sparse_table_with_rotation_values<28, 6>);
333 table.
get_table_values.push_back(&sparse_tables::get_sparse_table_with_rotation_values<28, 0>);
334 table.
get_table_values.push_back(&sparse_tables::get_sparse_table_with_rotation_values<28, 3>);
363 constexpr uint64_t base = 16;
374 rot2_coefficients[0] + rot13_coefficients[0] + rot22_coefficients[0],
375 rot2_coefficients[1] + rot13_coefficients[1] + rot22_coefficients[1],
376 rot2_coefficients[2] + rot13_coefficients[2] + rot22_coefficients[2],
379 bb::fr column_2_row_3_multiplier =
380 target_rotation_coefficients[1] * (-
bb::fr(base).
pow(11)) + target_rotation_coefficients[2];
386 MultiTable table(column_1_coefficients, column_2_coefficients, column_3_coefficients);
388 table.
slice_sizes = { (1 << 11), (1 << 11), (1 << 10) };
391 &sparse_tables::get_sparse_table_with_rotation_values<16, 2>,
392 &sparse_tables::get_sparse_table_with_rotation_values<16, 2>,
393 &sparse_tables::get_sparse_table_with_rotation_values<16, 0>,
constexpr uint64_t pow64(const uint64_t input, const uint64_t exponent)
MultiTable get_witness_extension_input_table(const MultiTableId id=SHA256_WITNESS_INPUT)
MultiTable get_majority_input_table(const MultiTableId id=SHA256_MAJ_INPUT)
BasicTable generate_choose_normalization_table(BasicTableId id, const size_t table_index)
MultiTable get_witness_extension_output_table(const MultiTableId id=SHA256_WITNESS_OUTPUT)
BasicTable generate_majority_normalization_table(BasicTableId id, const size_t table_index)
MultiTable get_choose_output_table(const MultiTableId id=SHA256_CH_OUTPUT)
std::array< bb::fr, 3 > get_choose_rotation_multipliers()
MultiTable get_choose_input_table(const MultiTableId id=SHA256_CH_INPUT)
MultiTable get_majority_output_table(const MultiTableId id=SHA256_MAJ_OUTPUT)
std::array< bb::fr, 3 > get_majority_rotation_multipliers()
plookup::BasicTable generate_witness_extension_normalization_table(BasicTableId id, const size_t table_index)
@ SHA256_WITNESS_SLICE_8_ROTATE_7
@ SHA256_WITNESS_SLICE_7_ROTATE_4
@ SHA256_WITNESS_NORMALIZE
@ SHA256_WITNESS_SLICE_14_ROTATE_1
field< Bn254FrParams > fr
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
BB_INLINE constexpr field pow(const uint256_t &exponent) const noexcept
A basic table from which we can perform lookups (for example, an xor table)
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