Barretenberg
The ZK-SNARK library at the core of Aztec
|
Stores a table of elliptic curve operations represented in the Ultra format. More...
#include <ecc_ops_table.hpp>
Public Member Functions | |
size_t | size () const |
size_t | ultra_table_size () const |
size_t | current_ultra_subtable_size () const |
size_t | previous_ultra_table_size () const |
void | create_new_subtable (size_t size_hint=0) |
void | push (const UltraOp &op) |
void | merge (MergeSettings settings=MergeSettings::PREPEND, std::optional< size_t > offset=std::nullopt) |
std::vector< UltraOp > | get_reconstructed () const |
ColumnPolynomials | construct_table_columns () const |
ColumnPolynomials | construct_previous_table_columns () const |
ColumnPolynomials | construct_current_ultra_ops_subtable_columns () const |
Static Public Attributes | |
static constexpr size_t | TABLE_WIDTH = 4 |
static constexpr size_t | NUM_ROWS_PER_OP = 2 |
Private Types | |
using | Curve = curve::BN254 |
using | Fr = Curve::ScalarField |
using | UltraOpsTable = EccOpsTable< UltraOp > |
using | TableView = std::array< std::span< Fr >, TABLE_WIDTH > |
using | ColumnPolynomials = std::array< Polynomial< Fr >, TABLE_WIDTH > |
Private Member Functions | |
ColumnPolynomials | construct_column_polynomials_with_fixed_append (const size_t poly_size) const |
Construct polynomials with fixed-location append. | |
ColumnPolynomials | construct_column_polynomials_from_subtables (const size_t poly_size, const size_t subtable_start_idx, const size_t subtable_end_idx) const |
Construct polynomials corresponding to the columns of the reconstructed ultra ops table for the given range of subtables TODO(https://github.com/AztecProtocol/barretenberg/issues/1267): multithread this functionality. | |
Static Private Member Functions | |
static void | write_op_to_polynomials (ColumnPolynomials &column_polynomials, const UltraOp &op, const size_t row_idx) |
Write a single UltraOp to the column polynomials at the given position. | |
Private Attributes | |
size_t | current_subtable_idx = 0 |
UltraOpsTable | table |
std::optional< size_t > | fixed_append_offset |
bool | has_fixed_append = false |
Stores a table of elliptic curve operations represented in the Ultra format.
An ECC operation OP involing point P(X,Y) and scalar z is represented in the Ultra format as a tuple of the form {OP, X_lo, X_hi, Y_lo, Y_hi, z1, z2}, where the coordinates are split into hi and lo limbs and z1, z2 are the endomorphism scalars associated with z. Because the Ultra/Mega arithmetization utilizes 4 wires, each op occupies two rows in a width-4 execution trace, arranged as follows:
OP | X_lo | X_hi | Y_lo 0 | Y_hi | z1 | z2
The table data is stored in the UltraOp tuple format but is converted to four columns of Fr scalars for use in the polynomials in the proving system.
Definition at line 218 of file ecc_ops_table.hpp.
|
private |
Definition at line 228 of file ecc_ops_table.hpp.
|
private |
Definition at line 224 of file ecc_ops_table.hpp.
|
private |
Definition at line 225 of file ecc_ops_table.hpp.
|
private |
Definition at line 227 of file ecc_ops_table.hpp.
|
private |
Definition at line 226 of file ecc_ops_table.hpp.
|
inlineprivate |
Construct polynomials corresponding to the columns of the reconstructed ultra ops table for the given range of subtables TODO(https://github.com/AztecProtocol/barretenberg/issues/1267): multithread this functionality.
target_columns |
Definition at line 373 of file ecc_ops_table.hpp.
|
inlineprivate |
Construct polynomials with fixed-location append.
Process prepended subtables first, then place the appended subtable at the fixed offset
Definition at line 336 of file ecc_ops_table.hpp.
|
inline |
Definition at line 303 of file ecc_ops_table.hpp.
|
inline |
Definition at line 292 of file ecc_ops_table.hpp.
|
inline |
Definition at line 276 of file ecc_ops_table.hpp.
|
inline |
Definition at line 255 of file ecc_ops_table.hpp.
|
inline |
Definition at line 253 of file ecc_ops_table.hpp.
|
inline |
Definition at line 273 of file ecc_ops_table.hpp.
|
inline |
Definition at line 257 of file ecc_ops_table.hpp.
|
inline |
Definition at line 254 of file ecc_ops_table.hpp.
|
inline |
Definition at line 256 of file ecc_ops_table.hpp.
|
inline |
Definition at line 238 of file ecc_ops_table.hpp.
|
inline |
Definition at line 239 of file ecc_ops_table.hpp.
|
inlinestaticprivate |
Write a single UltraOp to the column polynomials at the given position.
Each op is written across 2 rows (NUM_ROWS_PER_OP)
column_polynomials | The column polynomials to write to |
op | The operation to write |
row_idx | The starting row index (will write to row_idx and row_idx+1) |
Definition at line 320 of file ecc_ops_table.hpp.
|
private |
Definition at line 230 of file ecc_ops_table.hpp.
|
private |
Definition at line 234 of file ecc_ops_table.hpp.
|
private |
Definition at line 235 of file ecc_ops_table.hpp.
|
staticconstexpr |
Definition at line 221 of file ecc_ops_table.hpp.
|
private |
Definition at line 231 of file ecc_ops_table.hpp.
|
staticconstexpr |
Definition at line 220 of file ecc_ops_table.hpp.