Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::EccOpCode Struct Reference

Defines the opcodes for ECC operations used in both the Ultra and ECCVM formats. There are three opcodes that are reflected in both ultra ops and eccvm table and so, that lead to actual operations in the ECCVM : More...

#include <ecc_ops_table.hpp>

Public Types

using Fr = curve::BN254::ScalarField
 

Public Member Functions

bool operator== (const EccOpCode &other) const =default
 
uint32_t value () const
 

Public Attributes

bool add = false
 
bool mul = false
 
bool eq = false
 
bool reset = false
 
bool is_random_op = false
 
Fr random_value_1 = Fr(0)
 
Fr random_value_2 = Fr(0)
 

Detailed Description

Defines the opcodes for ECC operations used in both the Ultra and ECCVM formats. There are three opcodes that are reflected in both ultra ops and eccvm table and so, that lead to actual operations in the ECCVM :

  • addition: add = true, value() = 8
  • multiplication: mul = true, value() = 4
  • equality abd reset: eq = true, reset = true, value() = 3 On top of that, we see two more opcodes reflected only in the ultra ops table
  • no operation: all false, value() = 0 - The ultra ops table is seen as 4 column polynomials in the merge protocol and translator. We need to be able to shift these polynomials in translator and so they will have to start with zeroes
  • random operation: value() should never be called on this - To randomise the commitment and evaluations of the op column polynomial in merge protocol and translator we have to add sufficient randomness. We do this via a "random op" in which case two indices of the op column will be populated with random scalars.

Definition at line 37 of file ecc_ops_table.hpp.

Member Typedef Documentation

◆ Fr

Definition at line 38 of file ecc_ops_table.hpp.

Member Function Documentation

◆ operator==()

bool bb::EccOpCode::operator== ( const EccOpCode other) const
default

◆ value()

uint32_t bb::EccOpCode::value ( ) const
inline

Definition at line 49 of file ecc_ops_table.hpp.

Member Data Documentation

◆ add

bool bb::EccOpCode::add = false

Definition at line 39 of file ecc_ops_table.hpp.

◆ eq

bool bb::EccOpCode::eq = false

Definition at line 41 of file ecc_ops_table.hpp.

◆ is_random_op

bool bb::EccOpCode::is_random_op = false

Definition at line 45 of file ecc_ops_table.hpp.

◆ mul

bool bb::EccOpCode::mul = false

Definition at line 40 of file ecc_ops_table.hpp.

◆ random_value_1

Fr bb::EccOpCode::random_value_1 = Fr(0)

Definition at line 46 of file ecc_ops_table.hpp.

◆ random_value_2

Fr bb::EccOpCode::random_value_2 = Fr(0)

Definition at line 47 of file ecc_ops_table.hpp.

◆ reset

bool bb::EccOpCode::reset = false

Definition at line 42 of file ecc_ops_table.hpp.


The documentation for this struct was generated from the following file: