|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Functions | |
| template<uint64_t base, uint64_t num_rotated_bits> | |
| std::array< bb::fr, 2 > | get_sparse_table_with_rotation_values (const std::array< uint64_t, 2 > key) |
| Computes the C2 and C3 column values for a sparse lookup table with optional rotation. | |
| template<uint64_t base, uint64_t bits_per_slice, uint64_t num_rotated_bits> | |
| BasicTable | generate_sparse_table_with_rotation (BasicTableId id, const size_t table_index) |
| Generates a BasicTable for converting values to sparse form with optional rotation. | |
| template<size_t base, const uint64_t * base_table> | |
| std::array< bb::fr, 2 > | get_sparse_normalization_values (const std::array< uint64_t, 2 > key) |
| Computes the normalized output for a sparse value based on a provided normalization table. | |
| template<size_t base, uint64_t num_bits, const uint64_t * base_table> | |
| BasicTable | generate_sparse_normalization_table (BasicTableId id, const size_t table_index) |
| Generates a BasicTable for normalizing sparse form values back to normal form. | |
|
inline |
Generates a BasicTable for normalizing sparse form values back to normal form.
This table converts sparse arithmetic results into actual bit values. Each sparse digit encodes a sum of bits; the normalization table extracts the XOR result (and optionally other Boolean function results like Ch or Maj).
Table structure (base^num_bits many entries):
num_bits digitsThe num_bits parameter controls how many bits are normalized per lookup. Larger num_bits = fewer lookups needed, but larger table.
| base | The sparse form base |
| num_bits | Number of sparse digits (= original bits) processed per lookup |
| base_table | The per-digit normalization table (e.g., choose_normalization_table) |
Definition at line 144 of file sparse.hpp.
|
inline |
Generates a BasicTable for converting values to sparse form with optional rotation.
Creates a lookup table with three columns:
Step sizes are configured for accumulator building:
Also sets get_values_from_key to enable on-the-fly value computation during lookups.
| base | The sparse form base |
| bits_per_slice | Number of bits in each table entry (determines table size = 2^bits_per_slice) |
| num_rotated_bits | The number of bits to rotate for C3 values (0 = no rotation) |
Definition at line 62 of file sparse.hpp.
|
inline |
Computes the normalized output for a sparse value based on a provided normalization table.
| base | The sparse form base |
| base_table | The normalization lookup table (maps sparse digit → normalized bit(s)) |
| key | The lookup key; key[0] is the sparse input value, key[1] is unused |
Definition at line 107 of file sparse.hpp.
|
inline |
Computes the C2 and C3 column values for a sparse lookup table with optional rotation.
| base | The sparse form base |
| num_rotated_bits | The number of bits to rotate the input by for the C3 value (0 = no rotation) |
| key | The lookup key; key[0] is the input value (a limb), key[1] is unused |
Definition at line 30 of file sparse.hpp.