|
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 | num_ops () const |
| size_t | num_ultra_rows () 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) |
| size_t | get_current_subtable_size () const |
| std::vector< UltraOp > | get_reconstructed () const |
| std::vector< UltraOp > | get_reconstructed_with_fixed_append () 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 | 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. | |
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 222 of file ecc_ops_table.hpp.
|
private |
Definition at line 231 of file ecc_ops_table.hpp.
|
private |
Definition at line 228 of file ecc_ops_table.hpp.
|
private |
Definition at line 229 of file ecc_ops_table.hpp.
|
private |
Definition at line 230 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.
| target_columns |
Definition at line 422 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 386 of file ecc_ops_table.hpp.
|
inline |
Definition at line 353 of file ecc_ops_table.hpp.
|
inline |
Definition at line 342 of file ecc_ops_table.hpp.
|
inline |
Definition at line 326 of file ecc_ops_table.hpp.
|
inline |
Definition at line 264 of file ecc_ops_table.hpp.
|
inline |
Definition at line 262 of file ecc_ops_table.hpp.
|
inline |
Definition at line 282 of file ecc_ops_table.hpp.
|
inline |
Definition at line 284 of file ecc_ops_table.hpp.
|
inline |
Definition at line 291 of file ecc_ops_table.hpp.
|
inline |
Definition at line 266 of file ecc_ops_table.hpp.
|
inline |
Definition at line 245 of file ecc_ops_table.hpp.
|
inline |
Definition at line 248 of file ecc_ops_table.hpp.
|
inline |
Definition at line 263 of file ecc_ops_table.hpp.
|
inline |
Definition at line 265 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 370 of file ecc_ops_table.hpp.
|
private |
Definition at line 233 of file ecc_ops_table.hpp.
|
private |
Definition at line 240 of file ecc_ops_table.hpp.
|
private |
Definition at line 241 of file ecc_ops_table.hpp.
|
staticconstexpr |
Definition at line 225 of file ecc_ops_table.hpp.
|
private |
Definition at line 234 of file ecc_ops_table.hpp.
|
staticconstexpr |
Definition at line 224 of file ecc_ops_table.hpp.