Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
graph_description_bigfield.test.cpp File Reference

Go to the source code of this file.

Typedefs

using Builder = UltraCircuitBuilder
 
using bn254 = stdlib::bn254< Builder >
 
using fr_ct = bn254::ScalarField
 
using fq_ct = bn254::BaseField
 
using public_witness_ct = bn254::public_witness_ct
 
using witness_ct = bn254::witness_ct
 

Functions

void fix_bigfield_element (const fq_ct &element)
 Fix a bigfield element to prevent it from being identified as a variable in one gate.
 
 TEST (boomerang_bigfield, test_graph_description_bigfield_constructors)
 Test graph description for bigfield constructors.
 
 TEST (boomerang_bigfield, test_graph_description_bigfield_addition)
 Test graph description for bigfield addition operations.
 
 TEST (boomerang_bigfield, test_graph_description_bigfield_substraction)
 Test graph description for bigfield subtraction operations.
 
 TEST (boomerang_bigfield, test_graph_description_bigfield_multiplication)
 Test graph description for bigfield multiplication operations.
 
 TEST (boomerang_bigfield, test_graph_description_bigfield_division)
 Test graph description for bigfield division operations.
 
 TEST (boomerang_bigfield, test_graph_description_bigfield_mix_operations)
 Test graph description for mixed bigfield operations.
 
 TEST (boomerang_bigfield, test_graph_description_constructor_high_low_bits_and_operations)
 Test graph description for high/low bits constructor and operations.
 
 TEST (boomerang_bigfield, test_graph_description_mul_function)
 Test graph description for multiple multiplication operations.
 
 TEST (boomerang_bigfield, test_graph_description_sqr_function)
 Test graph description for square operations.
 
 TEST (boomerang_bigfield, test_graph_description_madd_function)
 Test graph description for multiply-add operations.
 
 TEST (boomerang_bigfield, test_graph_description_mult_madd_function)
 Test graph description for multiple multiply-add operations.
 
 TEST (boomerang_bigfield, test_graph_description_constructor_high_low_bits)
 Test graph description for high/low bits constructor.
 

Typedef Documentation

◆ bn254

Definition at line 27 of file graph_description_bigfield.test.cpp.

◆ Builder

◆ fq_ct

Definition at line 29 of file graph_description_bigfield.test.cpp.

◆ fr_ct

Definition at line 28 of file graph_description_bigfield.test.cpp.

◆ public_witness_ct

◆ witness_ct

Function Documentation

◆ fix_bigfield_element()

void fix_bigfield_element ( const fq_ct element)

Fix a bigfield element to prevent it from being identified as a variable in one gate.

Static analyzer usually prints input and output variables as variables in one gate. In tests these variables are not dangerous and usually we can filter them by fixing the witness which adds a gate. Then these variables will be in 2 gates, and static analyzer won't print them.

Parameters
elementThe bigfield element to fix

Definition at line 42 of file graph_description_bigfield.test.cpp.

◆ TEST() [1/12]

TEST ( boomerang_bigfield  ,
test_graph_description_bigfield_addition   
)

Test graph description for bigfield addition operations.

Tests various addition combinations with fix_bigfield_element.

The result is one connected component with no variables in one gate.

Definition at line 84 of file graph_description_bigfield.test.cpp.

◆ TEST() [2/12]

TEST ( boomerang_bigfield  ,
test_graph_description_bigfield_constructors   
)

Test graph description for bigfield constructors.

Tests construction of:

  • Constant value
  • Witness from u512
  • Small field witness
  • Mixed construction with lower limb addition

The result is one connected component with one variable in one gate.

Definition at line 61 of file graph_description_bigfield.test.cpp.

◆ TEST() [3/12]

TEST ( boomerang_bigfield  ,
test_graph_description_bigfield_division   
)

Test graph description for bigfield division operations.

Tests division operations with circuit checking. Each division operator creates one inverse variable for polynomial gate check (a * a_inv - 1 = 0).

The result is one connected component with three variables in one gate.

Definition at line 180 of file graph_description_bigfield.test.cpp.

◆ TEST() [4/12]

TEST ( boomerang_bigfield  ,
test_graph_description_bigfield_mix_operations   
)

Test graph description for mixed bigfield operations.

Tests combinations of addition, subtraction, multiplication and division operations.

The result is one connected component with two variables in one gate.

Definition at line 212 of file graph_description_bigfield.test.cpp.

◆ TEST() [5/12]

TEST ( boomerang_bigfield  ,
test_graph_description_bigfield_multiplication   
)

Test graph description for bigfield multiplication operations.

Tests all possible multiplication combinations.

The result is one connected component with no variables in one gate.

Definition at line 150 of file graph_description_bigfield.test.cpp.

◆ TEST() [6/12]

TEST ( boomerang_bigfield  ,
test_graph_description_bigfield_substraction   
)

Test graph description for bigfield subtraction operations.

Tests all possible subtraction combinations between mixed, constant, and variable values.

The result is one connected component with no variables in one gate.

Definition at line 115 of file graph_description_bigfield.test.cpp.

◆ TEST() [7/12]

TEST ( boomerang_bigfield  ,
test_graph_description_constructor_high_low_bits   
)

Test graph description for high/low bits constructor.

Tests basic multiplication with bit-sliced construction.

The result is connected components with no variables in one gate.

Definition at line 403 of file graph_description_bigfield.test.cpp.

◆ TEST() [8/12]

TEST ( boomerang_bigfield  ,
test_graph_description_constructor_high_low_bits_and_operations   
)

Test graph description for high/low bits constructor and operations.

Tests bit-sliced construction and repeated additions.

The result is one connected component with no variables in one gate.

Definition at line 265 of file graph_description_bigfield.test.cpp.

◆ TEST() [9/12]

TEST ( boomerang_bigfield  ,
test_graph_description_madd_function   
)

Test graph description for multiply-add operations.

Tests multiply-add operations with three inputs.

The result is num_repetitions connected components with no variables in one gate.

Definition at line 339 of file graph_description_bigfield.test.cpp.

◆ TEST() [10/12]

TEST ( boomerang_bigfield  ,
test_graph_description_mul_function   
)

Test graph description for multiple multiplication operations.

Tests independent multiplication operations.

The result is num_repetitions connected components with no variables in one gate.

Definition at line 293 of file graph_description_bigfield.test.cpp.

◆ TEST() [11/12]

TEST ( boomerang_bigfield  ,
test_graph_description_mult_madd_function   
)

Test graph description for multiple multiply-add operations.

Tests batch multiply-add operations with multiple inputs. Uses arrays of size number_of_madds=16 for left multiply, right multiply and add values.

The result is connected components with no variables in one gate.

Definition at line 366 of file graph_description_bigfield.test.cpp.

◆ TEST() [12/12]

TEST ( boomerang_bigfield  ,
test_graph_description_sqr_function   
)

Test graph description for square operations.

Tests repeated squaring operations on random inputs.

The result is num_repetitions connected components with no variables in one gate.

Definition at line 317 of file graph_description_bigfield.test.cpp.