49 [[nodiscard]] uint32_t
value()
const
52 throw_or_abort(
"EccOpCode::value() should not be called on a random op");
54 auto res =
static_cast<uint32_t
>(
add);
56 res +=
static_cast<uint32_t
>(
mul);
58 res +=
static_cast<uint32_t
>(
eq);
60 res +=
static_cast<uint32_t
>(
reset);
85 return {
Fq(0),
Fq(0) };
123 "Current subtable should be merged before computing the size of the full table of ecc ops.");
145 ASSERT(
current_subtable.empty(),
"Cannot create a new subtable until the current subtable has been merged.");
153 "Current subtable should be merged before attempting to index into the full table.");
162 return table.front().front();
169 "current subtable should be merged before reconstructing the full table of operations.");
195 ASSERT(
current_subtable.empty(),
"current subtable should be empty after merging. Check the merge logic.");
244 size_t last_subtable_size = 0;
286 const size_t subtable_start_idx = 0;
323 column_polynomials[1].at(row_idx) = op.
x_lo;
324 column_polynomials[2].at(row_idx) = op.
x_hi;
325 column_polynomials[3].at(row_idx) = op.
y_lo;
327 column_polynomials[1].at(row_idx + 1) = op.
y_hi;
328 column_polynomials[2].at(row_idx + 1) = op.
z_1;
329 column_polynomials[3].at(row_idx + 1) = op.
z_2;
339 for (
auto& poly : column_polynomials) {
345 for (
size_t subtable_idx = 0; subtable_idx <
table.
num_subtables() - 1; ++subtable_idx) {
346 const auto& subtable =
table.
get()[subtable_idx];
347 for (
const auto& op : subtable) {
357 size_t j = append_position;
358 for (
const auto& op : appended_subtable) {
364 return column_polynomials;
374 const size_t subtable_start_idx,
375 const size_t subtable_end_idx)
const
378 for (
auto& poly : column_polynomials) {
383 for (
size_t subtable_idx = subtable_start_idx; subtable_idx < subtable_end_idx; ++subtable_idx) {
384 const auto& subtable =
table.
get()[subtable_idx];
385 for (
const auto& op : subtable) {
390 return column_polynomials;
#define BB_ASSERT_LT(left, right,...)
#define ASSERT(expression,...)
A table of ECC operations.
std::vector< OpFormat > Subtable
void create_new_subtable(size_t size_hint=0)
std::deque< Subtable > table
Subtable current_subtable
size_t num_subtables() const
std::vector< OpFormat > get_reconstructed() const
const OpFormat & operator[](size_t index) const
void merge(MergeSettings settings=MergeSettings::PREPEND)
void push(const OpFormat &op)
Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x .....
Stores a table of elliptic curve operations represented in the Ultra format.
std::optional< size_t > fixed_append_offset
void push(const UltraOp &op)
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...
ColumnPolynomials construct_current_ultra_ops_subtable_columns() const
ColumnPolynomials construct_table_columns() const
std::array< Polynomial< Fr >, TABLE_WIDTH > ColumnPolynomials
size_t current_subtable_idx
std::array< std::span< Fr >, TABLE_WIDTH > TableView
ColumnPolynomials construct_previous_table_columns() const
static constexpr size_t NUM_ROWS_PER_OP
void create_new_subtable(size_t size_hint=0)
ColumnPolynomials construct_column_polynomials_with_fixed_append(const size_t poly_size) const
Construct polynomials with fixed-location append.
size_t current_ultra_subtable_size() const
size_t previous_ultra_table_size() const
std::vector< UltraOp > get_reconstructed() const
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.
static constexpr size_t TABLE_WIDTH
size_t ultra_table_size() const
void merge(MergeSettings settings=MergeSettings::PREPEND, std::optional< size_t > offset=std::nullopt)
Entry point for Barretenberg command-line interface.
MergeSettings
The MergeSettings define whether an current subtable will be added at the beginning (PREPEND) or at t...
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Curve::Group::affine_element AffineElement
bool operator==(const ECCVMOperation &other) const =default
Defines the opcodes for ECC operations used in both the Ultra and ECCVM formats. There are three opco...
bool operator==(const EccOpCode &other) const =default
curve::BN254::ScalarField Fr
std::array< Fq, 2 > get_base_point_standard_form() const
Get the point in standard form i.e. as two coordinates x and y in the base field or as a point at inf...
curve::BN254::BaseField Fq
void throw_or_abort(std::string const &err)