Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
plookup_tables.cpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Complete, auditors: [Luke, Raju], commit: dd03c4a23ab067274b4964cacb36d1545f73fb14}
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6//
7// === CODE ROLE: Builder-agnostic native computation ===
8// This file performs pure computation without modifying any circuit builder. All functions here
9// operate on native field elements (bb::fr) and return computed values. No witnesses or gates are created.
10//
11// Key functions:
12// - get_lookup_accumulators(): Slices inputs, computes table values, builds accumulator arrays.
13// This is the core native lookup logic. Returns ReadData<bb::fr> with computed values.
14// - get_multitable(): Returns a MultiTable by ID (lazy initialization of all tables)
15// - create_basic_table(): Factory function for BasicTable creation by ID
16//
17// The output of get_lookup_accumulators() is passed to ultra_circuit_builder::create_gates_from_plookup_accumulators()
18// which actually creates the lookup gates in the circuit.
19// =====================
20
21#include "plookup_tables.hpp"
31
37namespace bb::plookup {
38
39using namespace bb;
40
41namespace {
43{
44 // C++11 guarantees thread-safe initialization of static local variables
60 tables[MultiTableId::UINT8_XOR] = uint_tables::get_uint_xor_table<8>(MultiTableId::UINT8_XOR);
61 tables[MultiTableId::UINT16_XOR] = uint_tables::get_uint_xor_table<16>(MultiTableId::UINT16_XOR);
62 tables[MultiTableId::UINT32_XOR] = uint_tables::get_uint_xor_table<32>(MultiTableId::UINT32_XOR);
63 tables[MultiTableId::UINT64_XOR] = uint_tables::get_uint_xor_table<64>(MultiTableId::UINT64_XOR);
64 tables[MultiTableId::UINT8_AND] = uint_tables::get_uint_and_table<8>(MultiTableId::UINT8_AND);
65 tables[MultiTableId::UINT16_AND] = uint_tables::get_uint_and_table<16>(MultiTableId::UINT16_AND);
66 tables[MultiTableId::UINT32_AND] = uint_tables::get_uint_and_table<32>(MultiTableId::UINT32_AND);
67 tables[MultiTableId::UINT64_AND] = uint_tables::get_uint_and_table<64>(MultiTableId::UINT64_AND);
103 // secp256r1 tables for fixed-base mul
104 using secp256r1_fb = secp256r1_fixed_base::table;
106 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_XLO_LO, secp256r1_fb::AXIS_XLO, true);
108 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_XLO_HI, secp256r1_fb::AXIS_XLO, false);
110 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_XHI_LO, secp256r1_fb::AXIS_XHI, true);
112 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_XHI_HI, secp256r1_fb::AXIS_XHI, false);
114 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_YLO_LO, secp256r1_fb::AXIS_YLO, true);
116 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_YLO_HI, secp256r1_fb::AXIS_YLO, false);
118 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_YHI_LO, secp256r1_fb::AXIS_YHI, true);
120 secp256r1_fb::get_multitable(MultiTableId::SECP256R1_FIXED_BASE_YHI_HI, secp256r1_fb::AXIS_YHI, false);
122 fixed_base::table::get_fixed_base_table<0, 128>(MultiTableId::FIXED_BASE_LEFT_LO);
124 fixed_base::table::get_fixed_base_table<1, 126>(MultiTableId::FIXED_BASE_LEFT_HI);
126 fixed_base::table::get_fixed_base_table<2, 128>(MultiTableId::FIXED_BASE_RIGHT_LO);
128 fixed_base::table::get_fixed_base_table<3, 126>(MultiTableId::FIXED_BASE_RIGHT_HI);
129
130 bb::constexpr_for<0, 25, 1>([&]<size_t i>() {
131 tables[static_cast<size_t>(MultiTableId::KECCAK_NORMALIZE_AND_ROTATE) + i] =
133 });
135 return tables;
136 }();
137 return MULTI_TABLES;
138}
139} // namespace
150{
151 return get_multi_tables()[id];
152}
153
172 const fr& key_a,
173 const fr& key_b,
174 const bool is_2_to_1_lookup)
175{
176 // return multi-table, populating global array of all multi-tables if need be
177 const auto& multi_table = get_multitable(id);
178 const size_t num_lookups = multi_table.basic_table_ids.size();
179
180 // All MultiTable vectors must be consistently sized
181 BB_ASSERT_EQ(multi_table.column_1_coefficients.size(), num_lookups, "MultiTable coefficient/table count mismatch");
182 BB_ASSERT_EQ(multi_table.get_table_values.size(), num_lookups, "MultiTable get_table_values/table count mismatch");
183 BB_ASSERT_EQ(multi_table.slice_sizes.size(), num_lookups, "MultiTable slice_sizes/table count mismatch");
184
185 ReadData<bb::fr> lookup;
186 const auto key_a_slices = numeric::slice_input_using_variable_bases(key_a, multi_table.slice_sizes);
187 const auto key_b_slices = numeric::slice_input_using_variable_bases(key_b, multi_table.slice_sizes);
188
189 std::vector<fr> column_1_raw_values;
190 std::vector<fr> column_2_raw_values;
191 std::vector<fr> column_3_raw_values;
192
193 for (size_t i = 0; i < num_lookups; ++i) {
194 // compute the value(s) corresponding to the key(s) using the i-th basic table query function
195 const auto values = multi_table.get_table_values[i]({ key_a_slices[i], key_b_slices[i] });
196 // store all query data in raw columns and key entry
197 column_1_raw_values.emplace_back(key_a_slices[i]);
198 column_2_raw_values.emplace_back(is_2_to_1_lookup ? key_b_slices[i] : values[0]);
199 column_3_raw_values.emplace_back(is_2_to_1_lookup ? values[0] : values[1]);
200
201 // Store the lookup entries for use in constructing the sorted table/lookup polynomials later on
202 const BasicTable::LookupEntry lookup_entry{ { key_a_slices[i], key_b_slices[i] }, values };
203 lookup.lookup_entries.emplace_back(lookup_entry);
204 }
205
206 lookup[C1].resize(num_lookups);
207 lookup[C2].resize(num_lookups);
208 lookup[C3].resize(num_lookups);
209
249 lookup[C1][num_lookups - 1] = column_1_raw_values[num_lookups - 1];
250 lookup[C2][num_lookups - 1] = column_2_raw_values[num_lookups - 1];
251 lookup[C3][num_lookups - 1] = column_3_raw_values[num_lookups - 1];
252
253 for (size_t i = num_lookups - 1; i > 0; --i) {
254 lookup[C1][i - 1] = column_1_raw_values[i - 1] + lookup[C1][i] * multi_table.column_1_step_sizes[i];
255 lookup[C2][i - 1] = column_2_raw_values[i - 1] + lookup[C2][i] * multi_table.column_2_step_sizes[i];
256 lookup[C3][i - 1] = column_3_raw_values[i - 1] + lookup[C3][i] * multi_table.column_3_step_sizes[i];
257 }
258 return lookup;
259}
260
262{
263 BB_ASSERT_GT(index, 0U, "Table index must be greater than 0");
264
265 // we have >50 basic fixed base tables so we match with some logic instead of a switch statement
266 auto id_var = static_cast<size_t>(id);
267 if (id_var >= static_cast<size_t>(FIXED_BASE_0_0) && id_var < static_cast<size_t>(FIXED_BASE_1_0)) {
268 return fixed_base::table::generate_basic_fixed_base_table<0>(
269 id, index, id_var - static_cast<size_t>(FIXED_BASE_0_0));
270 }
271 if (id_var >= static_cast<size_t>(FIXED_BASE_1_0) && id_var < static_cast<size_t>(FIXED_BASE_2_0)) {
272 return fixed_base::table::generate_basic_fixed_base_table<1>(
273 id, index, id_var - static_cast<size_t>(FIXED_BASE_1_0));
274 }
275 if (id_var >= static_cast<size_t>(FIXED_BASE_2_0) && id_var < static_cast<size_t>(FIXED_BASE_3_0)) {
276 return fixed_base::table::generate_basic_fixed_base_table<2>(
277 id, index, id_var - static_cast<size_t>(FIXED_BASE_2_0));
278 }
279 if (id_var >= static_cast<size_t>(FIXED_BASE_3_0) && id_var < static_cast<size_t>(HONK_DUMMY_BASIC1)) {
280 return fixed_base::table::generate_basic_fixed_base_table<3>(
281 id, index, id_var - static_cast<size_t>(FIXED_BASE_3_0));
282 }
283 // Four contiguous ranges (32 IDs each) of basic tables back `secp256r1_fixed_base_mul`. ID
284 // `SECP256R1_FIXED_BASE_<AXIS>_0 + w` corresponds to axis AXIS, window position w.
285 if (id_var >= static_cast<size_t>(SECP256R1_FIXED_BASE_XLO_0) &&
286 id_var < static_cast<size_t>(SECP256R1_FIXED_BASE_XHI_0)) {
287 return secp256r1_fixed_base::table::generate_basic_table_runtime<secp256r1_fixed_base::table::AXIS_XLO>(
288 id, id_var - static_cast<size_t>(SECP256R1_FIXED_BASE_XLO_0), index);
289 }
290 if (id_var >= static_cast<size_t>(SECP256R1_FIXED_BASE_XHI_0) &&
291 id_var < static_cast<size_t>(SECP256R1_FIXED_BASE_YLO_0)) {
292 return secp256r1_fixed_base::table::generate_basic_table_runtime<secp256r1_fixed_base::table::AXIS_XHI>(
293 id, id_var - static_cast<size_t>(SECP256R1_FIXED_BASE_XHI_0), index);
294 }
295 if (id_var >= static_cast<size_t>(SECP256R1_FIXED_BASE_YLO_0) &&
296 id_var < static_cast<size_t>(SECP256R1_FIXED_BASE_YHI_0)) {
297 return secp256r1_fixed_base::table::generate_basic_table_runtime<secp256r1_fixed_base::table::AXIS_YLO>(
298 id, id_var - static_cast<size_t>(SECP256R1_FIXED_BASE_YLO_0), index);
299 }
300 if (id_var >= static_cast<size_t>(SECP256R1_FIXED_BASE_YHI_0) &&
301 id_var < static_cast<size_t>(SECP256R1_FIXED_BASE_END)) {
302 return secp256r1_fixed_base::table::generate_basic_table_runtime<secp256r1_fixed_base::table::AXIS_YHI>(
303 id, id_var - static_cast<size_t>(SECP256R1_FIXED_BASE_YHI_0), index);
304 }
305 switch (id) {
306 case AES_SPARSE_MAP: {
307 return sparse_tables::generate_sparse_table_with_rotation<9, 8, 0>(AES_SPARSE_MAP, index);
308 }
309 case AES_SBOX_MAP: {
311 }
314 }
317 }
319 return sparse_tables::generate_sparse_table_with_rotation<16, 3, 0>(SHA256_WITNESS_SLICE_3, index);
320 }
322 return sparse_tables::generate_sparse_table_with_rotation<16, 7, 4>(SHA256_WITNESS_SLICE_7_ROTATE_4, index);
323 }
325 return sparse_tables::generate_sparse_table_with_rotation<16, 8, 7>(SHA256_WITNESS_SLICE_8_ROTATE_7, index);
326 }
328 return sparse_tables::generate_sparse_table_with_rotation<16, 14, 1>(SHA256_WITNESS_SLICE_14_ROTATE_1, index);
329 }
330 case SHA256_CH_NORMALIZE: {
332 }
335 }
336 case SHA256_BASE28: {
337 return sparse_tables::generate_sparse_table_with_rotation<28, 11, 0>(SHA256_BASE28, index);
338 }
340 return sparse_tables::generate_sparse_table_with_rotation<28, 11, 6>(SHA256_BASE28_ROTATE6, index);
341 }
343 // 10-bit (not 11) for use with L2 slot of SHA256_CH_INPUT
344 return sparse_tables::generate_sparse_table_with_rotation<28, 10, 3>(SHA256_BASE28_ROTATE3, index);
345 }
346 case SHA256_BASE16: {
347 // 10-bit (not 11) for use with L2 slot of SHA256_CH_INPUT
348 return sparse_tables::generate_sparse_table_with_rotation<16, 10, 0>(SHA256_BASE16, index);
349 }
351 return sparse_tables::generate_sparse_table_with_rotation<16, 11, 2>(SHA256_BASE16_ROTATE2, index);
352 }
354 return uint_tables::generate_xor_rotate_table</*bits_per_slice=*/6, /*num_rotated_output_bits=*/0>(
356 }
358 return uint_tables::generate_xor_rotate_table</*bits_per_slice=*/4, /*num_rotated_output_bits=*/0>(
360 }
362 return uint_tables::generate_xor_rotate_table</*bits_per_slice=*/2, /*num_rotated_output_bits=*/0>(
364 }
366 return uint_tables::generate_and_rotate_table</*bits_per_slice=*/6, /*num_rotated_output_bits=*/0>(
368 }
370 return uint_tables::generate_and_rotate_table</*bits_per_slice=*/4, /*num_rotated_output_bits=*/0>(
372 }
374 return uint_tables::generate_and_rotate_table</*bits_per_slice=*/2, /*num_rotated_output_bits=*/0>(
376 }
377 case SECP256K1_XLO_BASIC: {
379 }
380 case SECP256K1_XHI_BASIC: {
382 }
383 case SECP256K1_YLO_BASIC: {
385 }
386 case SECP256K1_YHI_BASIC: {
388 }
391 index);
392 }
396 }
400 }
404 }
405 case BLAKE_XOR_ROTATE0: {
406 return blake2s_tables::generate_xor_rotate_table<6, 0>(BLAKE_XOR_ROTATE0, index);
407 }
409 return blake2s_tables::generate_xor_rotate_table<5, 0, true>(BLAKE_XOR_ROTATE0_SLICE5_MOD4, index);
410 }
411 case BLAKE_XOR_ROTATE2: {
412 return blake2s_tables::generate_xor_rotate_table<6, 2>(BLAKE_XOR_ROTATE2, index);
413 }
414 case BLAKE_XOR_ROTATE1: {
415 return blake2s_tables::generate_xor_rotate_table<6, 1>(BLAKE_XOR_ROTATE1, index);
416 }
417 case BLAKE_XOR_ROTATE4: {
418 return blake2s_tables::generate_xor_rotate_table<6, 4>(BLAKE_XOR_ROTATE4, index);
419 }
420 case HONK_DUMMY_BASIC1: {
421 return dummy_tables::generate_honk_dummy_table<HONK_DUMMY_BASIC1>(HONK_DUMMY_BASIC1, index);
422 }
423 case HONK_DUMMY_BASIC2: {
424 return dummy_tables::generate_honk_dummy_table<HONK_DUMMY_BASIC2>(HONK_DUMMY_BASIC2, index);
425 }
426 case KECCAK_INPUT: {
428 }
429 case KECCAK_THETA: {
431 }
432 case KECCAK_CHI: {
434 }
435 case KECCAK_OUTPUT: {
437 }
438 case KECCAK_RHO_1: {
440 }
441 case KECCAK_RHO_2: {
443 }
444 case KECCAK_RHO_3: {
446 }
447 case KECCAK_RHO_4: {
449 }
450 case KECCAK_RHO_5: {
452 }
453 case KECCAK_RHO_6: {
455 }
456 case KECCAK_RHO_7: {
458 }
459 case KECCAK_RHO_8: {
461 }
462 default: {
463 throw_or_abort("table id does not exist");
464 return sparse_tables::generate_sparse_table_with_rotation<9, 8, 0>(AES_SPARSE_MAP, index);
465 }
466 }
467}
468} // namespace bb::plookup
#define BB_ASSERT_GT(left, right,...)
Definition assert.hpp:113
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:83
Container for lookup accumulator values and table reads.
Definition types.hpp:377
std::vector< BasicTable::LookupEntry > lookup_entries
Definition types.hpp:383
static MultiTable get_yhi_table(const MultiTableId id, const BasicTableId basic_id)
static MultiTable get_xyprime_endo_table(const MultiTableId id, const BasicTableId basic_id)
static BasicTable generate_xlo_table(BasicTableId id, const size_t table_index)
static BasicTable generate_xyprime_endo_table(BasicTableId id, const size_t table_index)
static BasicTable generate_yhi_table(BasicTableId id, const size_t table_index)
static BasicTable generate_xlo_endo_table(BasicTableId id, const size_t table_index)
static BasicTable generate_ylo_table(BasicTableId id, const size_t table_index)
static BasicTable generate_xhi_table(BasicTableId id, const size_t table_index)
static MultiTable get_xlo_endo_table(const MultiTableId id, const BasicTableId basic_id)
static MultiTable get_xyprime_table(const MultiTableId id, const BasicTableId basic_id)
static MultiTable get_xhi_endo_table(const MultiTableId id, const BasicTableId basic_id)
static BasicTable generate_xyprime_table(BasicTableId id, const size_t table_index)
static BasicTable generate_xhi_endo_table(BasicTableId id, const size_t table_index)
static MultiTable get_xhi_table(const MultiTableId id, const BasicTableId basic_id)
static MultiTable get_xlo_table(const MultiTableId id, const BasicTableId basic_id)
static MultiTable get_ylo_table(const MultiTableId id, const BasicTableId basic_id)
static BasicTable generate_chi_renormalization_table(BasicTableId id, const size_t table_index)
Generate the CHI plookup table.
static MultiTable get_chi_output_table(const MultiTableId id=KECCAK_CHI_OUTPUT)
Create the CHI MultiTable used by plookup to generate a sequence of lookups.
static MultiTable get_keccak_input_table(const MultiTableId id=KECCAK_FORMAT_INPUT)
Create the KeccakInput MultiTable used by plookup to generate a sequence of lookups.
static BasicTable generate_keccak_input_table(BasicTableId id, const size_t table_index)
Generate plookup table that maps a TABLE_BITS-slice of a base-2 integer into a base-11 representation...
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.
static MultiTable get_rho_output_table(const MultiTableId id=KECCAK_NORMALIZE_AND_ROTATE)
Create the Rho MultiTable used by plookup to generate a sequence of lookups.
static BasicTable generate_rho_renormalization_table(BasicTableId id, const size_t table_index)
Generate plookup table that normalizes a TABLE_BITS-slice of a base-11 integer and extracts the msb.
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 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.
This file contains functions for the dummy tables that we use in UltraHonk to make table,...
std::vector< uint64_t > slice_input_using_variable_bases(const uint256_t &input, const std::vector< uint64_t > &bases)
Decompose a uint256_t using a different base for each digit position (least-significant first)....
MultiTable get_aes_input_table(const MultiTableId id=AES_INPUT)
Creates a MultiTable for converting a 128-bit AES input block into 16 sparse-form bytes.
Definition aes128.hpp:165
BasicTable generate_aes_sparse_normalization_table(BasicTableId id, const size_t table_index)
Generates a BasicTable for normalizing 4 sparse digits back to valid sparse form.
Definition aes128.hpp:60
MultiTable get_aes_normalization_table(const MultiTableId id=AES_NORMALIZE)
Creates a MultiTable for normalizing 8 sparse digits back to binary digits.
Definition aes128.hpp:116
BasicTable generate_aes_sbox_table(BasicTableId id, const size_t table_index)
Generates a plookup table for AES S-box substitution with precomputed MixColumns values.
Definition aes128.hpp:241
MultiTable get_aes_sbox_table(const MultiTableId id=AES_SBOX)
Definition aes128.hpp:267
MultiTable get_blake2s_xor_rotate_8_table(const MultiTableId id=BLAKE_XOR_ROTATE_8)
Definition blake2s.hpp:152
MultiTable get_blake2s_xor_rotate_7_table(const MultiTableId id=BLAKE_XOR_ROTATE_7)
Definition blake2s.hpp:187
MultiTable get_blake2s_xor_rotate_16_table(const MultiTableId id=BLAKE_XOR_ROTATE_16)
Definition blake2s.hpp:117
MultiTable get_blake2s_xor_table(const MultiTableId id=BLAKE_XOR)
Definition blake2s.hpp:94
MultiTable get_honk_dummy_multitable()
Create a multitable for filling UltraHonk polynomials with non-zero values.
Definition dummy.hpp:84
MultiTable get_witness_extension_input_table(const MultiTableId id=SHA256_WITNESS_INPUT)
Constructs a MultiTable for decomposing a 32-bit word for message schedule extension.
Definition sha256.hpp:445
MultiTable get_majority_input_table(const MultiTableId id=SHA256_MAJ_INPUT)
Constructs a MultiTable for decomposing a into sparse form and computing rotation components for Σ₀(a...
Definition sha256.hpp:604
BasicTable generate_choose_normalization_table(BasicTableId id, const size_t table_index)
Generates a BasicTable for normalizing choose sparse digits.
Definition sha256.hpp:295
MultiTable get_witness_extension_output_table(const MultiTableId id=SHA256_WITNESS_OUTPUT)
Constructs a MultiTable for normalizing witness extension sparse results back to normal form.
Definition sha256.hpp:321
BasicTable generate_majority_normalization_table(BasicTableId id, const size_t table_index)
Generates a BasicTable for normalizing majority sparse digits.
Definition sha256.hpp:309
MultiTable get_choose_output_table(const MultiTableId id=SHA256_CH_OUTPUT)
Constructs a MultiTable for normalizing choose sparse results back to normal form.
Definition sha256.hpp:344
MultiTable get_choose_input_table(const MultiTableId id=SHA256_CH_INPUT)
Constructs a MultiTable for decomposing e into sparse form and computing rotation components for Σ₁(e...
Definition sha256.hpp:526
MultiTable get_majority_output_table(const MultiTableId id=SHA256_MAJ_OUTPUT)
Constructs a MultiTable for normalizing majority sparse results back to normal form.
Definition sha256.hpp:366
BasicTable generate_witness_extension_normalization_table(BasicTableId id, const size_t table_index)
Generates a BasicTable for normalizing witness extension sparse digits.
Definition sha256.hpp:281
BasicTable generate_xor_rotate_table(BasicTableId id, const size_t table_index)
Definition uint.hpp:22
BasicTable generate_and_rotate_table(BasicTableId id, const size_t table_index)
Definition uint.hpp:54
@ BLAKE_XOR_ROTATE0
Definition types.hpp:65
@ BLAKE_XOR_ROTATE0_SLICE5_MOD4
Definition types.hpp:66
@ KECCAK_THETA
Definition types.hpp:77
@ SHA256_WITNESS_SLICE_8_ROTATE_7
Definition types.hpp:42
@ KECCAK_INPUT
Definition types.hpp:76
@ KECCAK_RHO_5
Definition types.hpp:85
@ UINT_AND_SLICE_6_ROTATE_0
Definition types.hpp:54
@ SECP256R1_FIXED_BASE_YLO_0
Definition types.hpp:95
@ SECP256K1_XYPRIME_ENDO_BASIC
Definition types.hpp:64
@ SECP256R1_FIXED_BASE_XLO_0
Definition types.hpp:93
@ UINT_AND_SLICE_4_ROTATE_0
Definition types.hpp:56
@ UINT_XOR_SLICE_4_ROTATE_0
Definition types.hpp:53
@ KECCAK_RHO_4
Definition types.hpp:84
@ AES_SBOX_MAP
Definition types.hpp:37
@ KECCAK_RHO_6
Definition types.hpp:86
@ SHA256_BASE28
Definition types.hpp:46
@ SHA256_BASE16_ROTATE2
Definition types.hpp:50
@ AES_SPARSE_MAP
Definition types.hpp:36
@ SECP256K1_YLO_BASIC
Definition types.hpp:59
@ SHA256_CH_NORMALIZE
Definition types.hpp:44
@ UINT_XOR_SLICE_6_ROTATE_0
Definition types.hpp:51
@ FIXED_BASE_3_0
Definition types.hpp:73
@ SHA256_WITNESS_SLICE_3
Definition types.hpp:40
@ SHA256_MAJ_NORMALIZE
Definition types.hpp:45
@ AES_SPARSE_NORMALIZE
Definition types.hpp:38
@ SHA256_BASE28_ROTATE6
Definition types.hpp:47
@ UINT_AND_SLICE_2_ROTATE_0
Definition types.hpp:55
@ SECP256K1_XYPRIME_BASIC
Definition types.hpp:61
@ SECP256R1_FIXED_BASE_END
Definition types.hpp:97
@ SECP256R1_FIXED_BASE_XHI_0
Definition types.hpp:94
@ HONK_DUMMY_BASIC2
Definition types.hpp:75
@ SECP256K1_XLO_ENDO_BASIC
Definition types.hpp:62
@ SECP256K1_XLO_BASIC
Definition types.hpp:57
@ FIXED_BASE_0_0
Definition types.hpp:70
@ KECCAK_RHO_7
Definition types.hpp:87
@ SHA256_BASE16
Definition types.hpp:49
@ KECCAK_RHO_1
Definition types.hpp:81
@ KECCAK_OUTPUT
Definition types.hpp:80
@ SECP256K1_XHI_ENDO_BASIC
Definition types.hpp:63
@ BLAKE_XOR_ROTATE1
Definition types.hpp:67
@ KECCAK_RHO_8
Definition types.hpp:88
@ SECP256R1_FIXED_BASE_YHI_0
Definition types.hpp:96
@ SHA256_WITNESS_SLICE_7_ROTATE_4
Definition types.hpp:41
@ SECP256K1_YHI_BASIC
Definition types.hpp:60
@ FIXED_BASE_2_0
Definition types.hpp:72
@ FIXED_BASE_1_0
Definition types.hpp:71
@ SHA256_WITNESS_NORMALIZE
Definition types.hpp:39
@ SHA256_WITNESS_SLICE_14_ROTATE_1
Definition types.hpp:43
@ SECP256K1_XHI_BASIC
Definition types.hpp:58
@ KECCAK_RHO_3
Definition types.hpp:83
@ UINT_XOR_SLICE_2_ROTATE_0
Definition types.hpp:52
@ BLAKE_XOR_ROTATE2
Definition types.hpp:68
@ BLAKE_XOR_ROTATE4
Definition types.hpp:69
@ HONK_DUMMY_BASIC1
Definition types.hpp:74
@ KECCAK_RHO_2
Definition types.hpp:82
@ SHA256_BASE28_ROTATE3
Definition types.hpp:48
ReadData< bb::fr > get_lookup_accumulators(const MultiTableId id, const fr &key_a, const fr &key_b, const bool is_2_to_1_lookup)
Given a table ID and the key(s) for a key-value lookup, return the lookup accumulators.
@ KECCAK_FORMAT_INPUT
Definition types.hpp:148
@ SECP256K1_XLO
Definition types.hpp:122
@ BLAKE_XOR_ROTATE_16
Definition types.hpp:142
@ AES_NORMALIZE
Definition types.hpp:107
@ SECP256R1_FIXED_BASE_XLO_LO
Definition types.hpp:133
@ KECCAK_FORMAT_OUTPUT
Definition types.hpp:149
@ SECP256K1_XYPRIME
Definition types.hpp:126
@ SECP256K1_XYPRIME_ENDO
Definition types.hpp:129
@ SECP256R1_FIXED_BASE_XHI_LO
Definition types.hpp:135
@ HONK_DUMMY_MULTI
Definition types.hpp:145
@ SECP256K1_XLO_ENDO
Definition types.hpp:127
@ SECP256R1_FIXED_BASE_YLO_LO
Definition types.hpp:137
@ SECP256R1_FIXED_BASE_YLO_HI
Definition types.hpp:138
@ FIXED_BASE_RIGHT_HI
Definition types.hpp:113
@ FIXED_BASE_LEFT_LO
Definition types.hpp:110
@ KECCAK_NORMALIZE_AND_ROTATE
Definition types.hpp:150
@ SHA256_WITNESS_INPUT
Definition types.hpp:105
@ SHA256_CH_INPUT
Definition types.hpp:101
@ SHA256_MAJ_OUTPUT
Definition types.hpp:104
@ SECP256R1_FIXED_BASE_YHI_LO
Definition types.hpp:139
@ SECP256R1_FIXED_BASE_XHI_HI
Definition types.hpp:136
@ KECCAK_CHI_OUTPUT
Definition types.hpp:147
@ SECP256R1_FIXED_BASE_YHI_HI
Definition types.hpp:140
@ SHA256_CH_OUTPUT
Definition types.hpp:102
@ FIXED_BASE_LEFT_HI
Definition types.hpp:111
@ BLAKE_XOR_ROTATE_7
Definition types.hpp:144
@ SECP256K1_XHI_ENDO
Definition types.hpp:128
@ SHA256_WITNESS_OUTPUT
Definition types.hpp:106
@ SECP256K1_XHI
Definition types.hpp:123
@ SECP256K1_YLO
Definition types.hpp:124
@ SHA256_MAJ_INPUT
Definition types.hpp:103
@ BLAKE_XOR_ROTATE_8
Definition types.hpp:143
@ KECCAK_THETA_OUTPUT
Definition types.hpp:146
@ SECP256K1_YHI
Definition types.hpp:125
@ SECP256R1_FIXED_BASE_XLO_HI
Definition types.hpp:134
@ FIXED_BASE_RIGHT_LO
Definition types.hpp:112
BasicTable create_basic_table(const BasicTableId id, const size_t index)
const MultiTable & get_multitable(const MultiTableId id)
Return the multitable with the provided ID; construct all MultiTables if not constructed already.
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Plookup tables for SHA-256 using sparse form representation.
Definition types.hpp:306
A basic table from which we can perform lookups (for example, an xor table)
Definition types.hpp:305
Container for managing multiple BasicTables plus the data needed to combine basic table outputs (e....
Definition types.hpp:167
void throw_or_abort(std::string const &err)