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

Show that relation arithmetic has a simple form. More...

Go to the source code of this file.

Classes

class  TranslatorRelationConsistency
 

Typedefs

using Flavor = TranslatorFlavor
 
using FF = typename Flavor::FF
 
using InputElements = typename Flavor::AllValues
 

Functions

InputElements get_random_input ()
 
InputElements get_special_input ()
 
 TEST_F (TranslatorRelationConsistency, PermutationRelation)
 
 TEST_F (TranslatorRelationConsistency, DeltaRangeConstraintRelation)
 
 TEST_F (TranslatorRelationConsistency, DecompositionRelation)
 
 TEST_F (TranslatorRelationConsistency, OpcodeConstraintRelation)
 
 TEST_F (TranslatorRelationConsistency, AccumulatorTransferRelation)
 
 TEST_F (TranslatorRelationConsistency, ZeroConstraintsRelation)
 
 TEST_F (TranslatorRelationConsistency, NonNativeFieldRelation)
 

Detailed Description

Show that relation arithmetic has a simple form.

The purpose of this test suite is to show that the identity arithmetic implemented in the Relations is equivalent to a simpler unoptimized version implemented in the tests themselves. This is useful 1) as documentation since the simple implementations here should make the underlying arithmetic easier to see, and 2) as a check that optimizations introduced into the Relations have not changed the result.

For this purpose, we simply feed (the same) random inputs into each of the two implementations and confirm that the outputs match. This does not confirm the correctness of the identity arithmetic (the identities will not be satisfied in general by random inputs) only that the two implementations are equivalent.

Definition in file translator_relation_consistency.test.cpp.

Typedef Documentation

◆ FF

using FF = typename Flavor::FF

Definition at line 21 of file translator_relation_consistency.test.cpp.

◆ Flavor

◆ InputElements

using InputElements = typename Flavor::AllValues

Definition at line 22 of file translator_relation_consistency.test.cpp.

Function Documentation

◆ get_random_input()

InputElements get_random_input ( )

Definition at line 24 of file translator_relation_consistency.test.cpp.

◆ get_special_input()

InputElements get_special_input ( )

Definition at line 33 of file translator_relation_consistency.test.cpp.

◆ TEST_F() [1/7]

TEST_F ( TranslatorRelationConsistency  ,
AccumulatorTransferRelation   
)

Definition at line 754 of file translator_relation_consistency.test.cpp.

◆ TEST_F() [2/7]

TEST_F ( TranslatorRelationConsistency  ,
DecompositionRelation   
)

Check decomposition of a relation limb. Relation limbs are 84 bits, so the decompositon takes 6 14-bit microlimbs

Check the decomposition of a standard limb. Standard limbs are 68 bits, so we decompose them into 5 14-bit microlimbs

Check the decomposition of a standard top limb. Standard top limb is 50 bits (254 = 68 * 3 + 50)

Ensure that the last microlimb of a standard limb decomposition is 12 bits by checking a shifted version.

Ensure that the last microlimb of a standard top limb decomposition is 8 bits by checking a shifted version.

Ensure that the last microlimb of z top limb decomposition is 4 bits by checking a shifted version.

Ensure that the last microlimb of quotient top limb decomposition is 10 bits by checking a shifted version.

Check decomposition of wide 128-bit limbs into two 68-bit limbs.

Definition at line 179 of file translator_relation_consistency.test.cpp.

◆ TEST_F() [3/7]

◆ TEST_F() [4/7]

◆ TEST_F() [5/7]

TEST_F ( TranslatorRelationConsistency  ,
OpcodeConstraintRelation   
)

Definition at line 730 of file translator_relation_consistency.test.cpp.

◆ TEST_F() [6/7]

TEST_F ( TranslatorRelationConsistency  ,
PermutationRelation   
)

Definition at line 58 of file translator_relation_consistency.test.cpp.

◆ TEST_F() [7/7]

TEST_F ( TranslatorRelationConsistency  ,
ZeroConstraintsRelation   
)

Definition at line 817 of file translator_relation_consistency.test.cpp.