Barretenberg
The ZK-SNARK library at the core of Aztec
|
Used to construct execution trace representations of elliptic curve operations. More...
#include <ecc_op_queue.hpp>
Public Member Functions | |
ECCOpQueue () | |
Instantiate an initial ECC op subtable. | |
void | initialize_new_subtable () |
Initialize a new subtable for eccvm and ultra ops with the given merge settings. | |
void | merge (MergeSettings settings=MergeSettings::PREPEND, std::optional< size_t > ultra_fixed_offset=std::nullopt) |
std::array< Polynomial< Fr >, ULTRA_TABLE_WIDTH > | construct_ultra_ops_table_columns () const |
std::array< Polynomial< Fr >, ULTRA_TABLE_WIDTH > | construct_previous_ultra_ops_table_columns () const |
std::array< Polynomial< Fr >, ULTRA_TABLE_WIDTH > | construct_current_ultra_ops_subtable_columns () const |
void | construct_full_eccvm_ops_table () |
void | construct_full_ultra_ops_table () |
size_t | get_ultra_ops_table_num_rows () const |
size_t | get_current_ultra_ops_subtable_num_rows () const |
size_t | get_previous_ultra_ops_table_num_rows () const |
std::vector< ECCVMOperation > & | get_eccvm_ops () |
std::vector< UltraOp > & | get_ultra_ops () |
size_t | get_num_msm_rows () const |
Get the number of rows in the 'msm' column section, for all msms in the circuit. | |
size_t | get_num_rows () const |
Get the number of rows for the current ECCVM circuit. | |
uint32_t | get_number_of_muls () const |
get number of muls for the current ECCVM circuit | |
void | set_eccvm_ops_for_fuzzing (std::vector< ECCVMOperation > &eccvm_ops_in) |
A fuzzing only method for setting eccvm ops directly. | |
void | add_erroneous_equality_op_for_testing () |
A testing only method that adds an erroneous equality op to the eccvm ops. | |
void | empty_row_for_testing () |
Write empty row to queue. | |
Point | get_accumulator () |
UltraOp | add_accumulate (const Point &to_add) |
Write point addition op to queue and natively perform addition. | |
UltraOp | mul_accumulate (const Point &to_mul, const Fr &scalar) |
Write multiply and add op to queue and natively perform operation. | |
UltraOp | no_op_ultra_only () |
Writes a no op (i.e. two zero rows) to the ultra ops table but adds no eccvm operations. | |
UltraOp | random_op_ultra_only () |
Writes randomness to the ultra ops table but adds no eccvm operations. | |
UltraOp | eq_and_reset () |
Write equality op using internal accumulator point. | |
Private Types | |
using | Curve = curve::BN254 |
using | Point = Curve::AffineElement |
using | Fr = Curve::ScalarField |
using | Fq = Curve::BaseField |
Private Member Functions | |
void | append_eccvm_op (const ECCVMOperation &op) |
Append an eccvm operation to the eccvm ops table; update the eccvm row tracker. | |
UltraOp | construct_and_populate_ultra_ops (EccOpCode op_code, const Point &point, const Fr &scalar=Fr::zero()) |
Given an ecc operation and its inputs, decompose into ultra format and populate ultra_ops. | |
Private Attributes | |
Point | point_at_infinity = Curve::Group::affine_point_at_infinity |
Point | accumulator = point_at_infinity |
EccvmOpsTable | eccvm_ops_table |
UltraEccOpsTable | ultra_ops_table |
std::vector< ECCVMOperation > | eccvm_ops_reconstructed |
std::vector< UltraOp > | ultra_ops_reconstructed |
EccvmRowTracker | eccvm_row_tracker |
Static Private Attributes | |
static constexpr size_t | ULTRA_TABLE_WIDTH = UltraEccOpsTable::TABLE_WIDTH |
Used to construct execution trace representations of elliptic curve operations.
Constructs and stores tables of ECC operations in two formats: the ECCVM format and the Ultra-arithmetization (width-4) format. The ECCVM format is used to construct the execution trace for the ECCVM circuit, while the Ultra-arithmetization is used in the Mega circuits and the Translator VM. Both tables are constructed via successive pre-pending of subtables of the same format, where each subtable represents the operations of a single circuit. TODO(https://github.com/AztecProtocol/barretenberg/issues/1267): consider possible efficiency improvements
Definition at line 25 of file ecc_op_queue.hpp.
|
private |
Definition at line 26 of file ecc_op_queue.hpp.
|
private |
Definition at line 29 of file ecc_op_queue.hpp.
|
private |
Definition at line 28 of file ecc_op_queue.hpp.
|
private |
Definition at line 27 of file ecc_op_queue.hpp.
|
inline |
Instantiate an initial ECC op subtable.
Definition at line 54 of file ecc_op_queue.hpp.
Write point addition op to queue and natively perform addition.
to_add |
Definition at line 173 of file ecc_op_queue.hpp.
|
inline |
A testing only method that adds an erroneous equality op to the eccvm ops.
May be used to ensure that ECCVM responds as expected when encountering a bad op
Definition at line 149 of file ecc_op_queue.hpp.
|
inlineprivate |
Append an eccvm operation to the eccvm ops table; update the eccvm row tracker.
Definition at line 270 of file ecc_op_queue.hpp.
|
inlineprivate |
Given an ecc operation and its inputs, decompose into ultra format and populate ultra_ops.
op_code | |
point | |
scalar |
Definition at line 283 of file ecc_op_queue.hpp.
|
inline |
Definition at line 85 of file ecc_op_queue.hpp.
|
inline |
Definition at line 91 of file ecc_op_queue.hpp.
|
inline |
Definition at line 94 of file ecc_op_queue.hpp.
|
inline |
Definition at line 79 of file ecc_op_queue.hpp.
|
inline |
Definition at line 73 of file ecc_op_queue.hpp.
|
inline |
Write empty row to queue.
Definition at line 160 of file ecc_op_queue.hpp.
|
inline |
Write equality op using internal accumulator point.
Definition at line 253 of file ecc_op_queue.hpp.
|
inline |
Definition at line 166 of file ecc_op_queue.hpp.
|
inline |
Definition at line 97 of file ecc_op_queue.hpp.
|
inline |
Definition at line 104 of file ecc_op_queue.hpp.
|
inline |
Get the number of rows in the 'msm' column section, for all msms in the circuit.
Definition at line 123 of file ecc_op_queue.hpp.
|
inline |
Get the number of rows for the current ECCVM circuit.
Definition at line 128 of file ecc_op_queue.hpp.
|
inline |
get number of muls for the current ECCVM circuit
Definition at line 133 of file ecc_op_queue.hpp.
|
inline |
Definition at line 98 of file ecc_op_queue.hpp.
|
inline |
Definition at line 112 of file ecc_op_queue.hpp.
|
inline |
Definition at line 96 of file ecc_op_queue.hpp.
|
inline |
Initialize a new subtable for eccvm and ultra ops with the given merge settings.
Definition at line 60 of file ecc_op_queue.hpp.
|
inline |
Definition at line 66 of file ecc_op_queue.hpp.
Write multiply and add op to queue and natively perform operation.
to_add |
Definition at line 190 of file ecc_op_queue.hpp.
|
inline |
Writes a no op (i.e. two zero rows) to the ultra ops table but adds no eccvm operations.
We want to be able to add zero rows (and, eventually, random rows https://github.com/AztecProtocol/barretenberg/issues/1360) to the ultra ops table without affecting the operations in the ECCVM.
Definition at line 218 of file ecc_op_queue.hpp.
|
inline |
Writes randomness to the ultra ops table but adds no eccvm operations.
This method is used to add randomness to the ultra ops table with the aim of randomising the commitment and evaluations of its corresponding columns
Definition at line 232 of file ecc_op_queue.hpp.
|
inline |
A fuzzing only method for setting eccvm ops directly.
Definition at line 139 of file ecc_op_queue.hpp.
|
private |
Definition at line 34 of file ecc_op_queue.hpp.
|
private |
Definition at line 41 of file ecc_op_queue.hpp.
|
private |
Definition at line 36 of file ecc_op_queue.hpp.
|
private |
Definition at line 48 of file ecc_op_queue.hpp.
|
private |
Definition at line 31 of file ecc_op_queue.hpp.
|
private |
Definition at line 45 of file ecc_op_queue.hpp.
|
private |
Definition at line 37 of file ecc_op_queue.hpp.
|
staticconstexprprivate |
Definition at line 30 of file ecc_op_queue.hpp.