Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::constraining Namespace Reference

Namespaces

namespace  detail
 

Classes

class  AvmFixedVKCommitments
 Stores the fixed AVM VK commitments (to precomputed polynomials) that depend only on the precomputed columns. More...
 
class  AvmRecursiveTests
 
class  AvmRecursiveTestsParameterized
 
class  AvmVerifierTests
 
class  Poseidon2ConstrainingTest
 
class  Poseidon2MemoryConstrainingTest
 
class  TxExecutionConstrainingWithCalldataTest
 

Typedefs

using FF = AvmFlavorSettings::FF
 
using C = Column
 
using poseidon2_hash = bb::avm2::poseidon2_hash< FF >
 
using poseidon2_perm = bb::avm2::optimized_poseidon2_perm< FF >
 
using poseidon2_mem = bb::avm2::poseidon2_mem< FF >
 

Functions

 TEST (AvmFixedVKTests, FixedVKCommitments)
 Test that the fixed VK commitments agree with the ones computed from precomputed columns.
 
void run_check_circuit (AvmFlavor::ProverPolynomials &polys, size_t num_rows, bool skippable_enabled)
 
AvmProver::ProverPolynomials compute_polynomials (tracegen::TraceContainer &trace)
 
void resize_inverses (AvmFlavor::ProverPolynomials &prover_polynomials, Column inverses_col, Column src_selector_col, Column dst_selector_col)
 
std::shared_ptr< AvmProver::ProvingKeyproving_key_from_polynomials (AvmProver::ProverPolynomials &polynomials)
 
 TEST_P (AvmRecursiveTestsParameterized, GoblinRecursion)
 A test of the Goblinized AVM recursive verifier.
 
 INSTANTIATE_TEST_SUITE_P (PaddingVariants, AvmRecursiveTestsParameterized, ::testing::Values(false, true), [](const auto &info) { return info.param ? "Padded" :"Unpadded";})
 
 TEST_F (AvmRecursiveTests, GoblinRecursionFailsWithWrongPIs)
 
 TEST_F (Poseidon2ConstrainingTest, Poseidon2EmptyRow)
 
 TEST_F (Poseidon2ConstrainingTest, BasicPermutation)
 
 TEST_F (Poseidon2ConstrainingTest, HashWithSinglePermutation)
 
 TEST_F (Poseidon2ConstrainingTest, HashWithMultiplePermutation)
 
 TEST_F (Poseidon2ConstrainingTest, MultipleHashInvocations)
 
 TEST_F (Poseidon2ConstrainingTest, HashPermInteractions)
 
 TEST_F (Poseidon2ConstrainingTest, NegativeHashPermInteractions)
 
 TEST_F (Poseidon2MemoryConstrainingTest, PermutationMemory)
 
 TEST_F (Poseidon2MemoryConstrainingTest, PermutationMemoryInteractions)
 
 TEST_F (Poseidon2MemoryConstrainingTest, PermutationMemoryInvalidTag)
 
 TEST_F (Poseidon2MemoryConstrainingTest, PermutationMemoryInvalidAddressRange)
 
 TEST (TxExecutionConstrainingTest, WriteTreeValue)
 
 TEST_F (TxExecutionConstrainingTestHelper, CollectFees)
 
 TEST (TxExecutionConstrainingTest, NegativeTreePaddingChecks)
 
 TEST_F (TxExecutionConstrainingWithCalldataTest, SimpleHandleCalldata)
 
template<typename Relation , typename... Ts>
void check_relation (const tracegen::TestTraceContainer &trace, Ts... subrelation)
 
template<typename Relation >
void check_relation (const tracegen::TestTraceContainer &trace)
 
template<typename TraceBuilder , typename... Setting>
void check_interaction (tracegen::TestTraceContainer &trace)
 
template<typename TraceBuilder , typename... Setting>
void check_multipermutation_interaction (tracegen::TestTraceContainer &trace)
 
template<typename TraceBuilder >
void check_all_interactions (tracegen::TestTraceContainer &trace)
 
 TEST_F (AvmVerifierTests, GoodPublicInputs)
 
 TEST_F (AvmVerifierTests, NegativeBadPublicInputs)
 
 TEST_F (AvmVerifierTests, ProofSizeMatchesComputedConstant)
 

Typedef Documentation

◆ C

Definition at line 39 of file poseidon2.test.cpp.

◆ FF

Definition at line 38 of file poseidon2.test.cpp.

◆ poseidon2_hash

◆ poseidon2_mem

◆ poseidon2_perm

Function Documentation

◆ check_all_interactions()

template<typename TraceBuilder >
void bb::avm2::constraining::check_all_interactions ( tracegen::TestTraceContainer trace)
inline

Definition at line 93 of file check_relation.hpp.

◆ check_interaction()

template<typename TraceBuilder , typename... Setting>
void bb::avm2::constraining::check_interaction ( tracegen::TestTraceContainer trace)
inline

Definition at line 77 of file check_relation.hpp.

◆ check_multipermutation_interaction()

template<typename TraceBuilder , typename... Setting>
void bb::avm2::constraining::check_multipermutation_interaction ( tracegen::TestTraceContainer trace)
inline

Definition at line 85 of file check_relation.hpp.

◆ check_relation() [1/2]

template<typename Relation >
void bb::avm2::constraining::check_relation ( const tracegen::TestTraceContainer trace)

Definition at line 71 of file check_relation.hpp.

◆ check_relation() [2/2]

template<typename Relation , typename... Ts>
void bb::avm2::constraining::check_relation ( const tracegen::TestTraceContainer trace,
Ts...  subrelation 
)

Definition at line 65 of file check_relation.hpp.

◆ compute_polynomials()

AvmProver::ProverPolynomials bb::avm2::constraining::compute_polynomials ( tracegen::TraceContainer trace)

Definition at line 13 of file polynomials.cpp.

◆ INSTANTIATE_TEST_SUITE_P()

bb::avm2::constraining::INSTANTIATE_TEST_SUITE_P ( PaddingVariants  ,
AvmRecursiveTestsParameterized  ,
::testing::Values(false, true)  ,
[] (const auto &info) { return info.param ? "Padded" :"Unpadded";}   
)

◆ proving_key_from_polynomials()

std::shared_ptr< AvmProver::ProvingKey > bb::avm2::constraining::proving_key_from_polynomials ( AvmProver::ProverPolynomials polynomials)

Definition at line 108 of file polynomials.cpp.

◆ resize_inverses()

void bb::avm2::constraining::resize_inverses ( AvmFlavor::ProverPolynomials prover_polynomials,
Column  inverses_col,
Column  src_selector_col,
Column  dst_selector_col 
)

Definition at line 88 of file polynomials.cpp.

◆ run_check_circuit()

void bb::avm2::constraining::run_check_circuit ( AvmFlavor::ProverPolynomials polys,
size_t  num_rows,
bool  skippable_enabled 
)

Definition at line 18 of file check_circuit.cpp.

◆ TEST() [1/3]

bb::avm2::constraining::TEST ( AvmFixedVKTests  ,
FixedVKCommitments   
)

Test that the fixed VK commitments agree with the ones computed from precomputed columns.

Note
If this test fails, it may be because the precomputed columns have changed and the fixed VK commitments in AvmFixedVKCommitments must be updated accordingly. Their values can be taken from the output of this test by uncommenting the print statements.

Definition at line 16 of file avm_fixed_vk.test.cpp.

◆ TEST() [2/3]

bb::avm2::constraining::TEST ( TxExecutionConstrainingTest  ,
NegativeTreePaddingChecks   
)

Definition at line 701 of file tx.test.cpp.

◆ TEST() [3/3]

bb::avm2::constraining::TEST ( TxExecutionConstrainingTest  ,
WriteTreeValue   
)

Definition at line 441 of file tx.test.cpp.

◆ TEST_F() [1/17]

bb::avm2::constraining::TEST_F ( AvmRecursiveTests  ,
GoblinRecursionFailsWithWrongPIs   
)

Definition at line 181 of file recursive_verifier.test.cpp.

◆ TEST_F() [2/17]

bb::avm2::constraining::TEST_F ( AvmVerifierTests  ,
GoodPublicInputs   
)

Definition at line 40 of file verifier.test.cpp.

◆ TEST_F() [3/17]

bb::avm2::constraining::TEST_F ( AvmVerifierTests  ,
NegativeBadPublicInputs   
)

Definition at line 54 of file verifier.test.cpp.

◆ TEST_F() [4/17]

bb::avm2::constraining::TEST_F ( AvmVerifierTests  ,
ProofSizeMatchesComputedConstant   
)

Definition at line 79 of file verifier.test.cpp.

◆ TEST_F() [5/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
BasicPermutation   
)

Definition at line 87 of file poseidon2.test.cpp.

◆ TEST_F() [6/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
HashPermInteractions   
)

Definition at line 185 of file poseidon2.test.cpp.

◆ TEST_F() [7/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
HashWithMultiplePermutation   
)

Definition at line 139 of file poseidon2.test.cpp.

◆ TEST_F() [8/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
HashWithSinglePermutation   
)

Definition at line 116 of file poseidon2.test.cpp.

◆ TEST_F() [9/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
MultipleHashInvocations   
)

Definition at line 161 of file poseidon2.test.cpp.

◆ TEST_F() [10/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
NegativeHashPermInteractions   
)

Definition at line 207 of file poseidon2.test.cpp.

◆ TEST_F() [11/17]

bb::avm2::constraining::TEST_F ( Poseidon2ConstrainingTest  ,
Poseidon2EmptyRow   
)

Definition at line 79 of file poseidon2.test.cpp.

◆ TEST_F() [12/17]

bb::avm2::constraining::TEST_F ( Poseidon2MemoryConstrainingTest  ,
PermutationMemory   
)

Definition at line 249 of file poseidon2.test.cpp.

◆ TEST_F() [13/17]

bb::avm2::constraining::TEST_F ( Poseidon2MemoryConstrainingTest  ,
PermutationMemoryInteractions   
)

Definition at line 266 of file poseidon2.test.cpp.

◆ TEST_F() [14/17]

bb::avm2::constraining::TEST_F ( Poseidon2MemoryConstrainingTest  ,
PermutationMemoryInvalidAddressRange   
)

Definition at line 390 of file poseidon2.test.cpp.

◆ TEST_F() [15/17]

bb::avm2::constraining::TEST_F ( Poseidon2MemoryConstrainingTest  ,
PermutationMemoryInvalidTag   
)

Definition at line 330 of file poseidon2.test.cpp.

◆ TEST_F() [16/17]

bb::avm2::constraining::TEST_F ( TxExecutionConstrainingTestHelper  ,
CollectFees   
)

Definition at line 586 of file tx.test.cpp.

◆ TEST_F() [17/17]

bb::avm2::constraining::TEST_F ( TxExecutionConstrainingWithCalldataTest  ,
SimpleHandleCalldata   
)

Definition at line 778 of file tx.test.cpp.

◆ TEST_P()

bb::avm2::constraining::TEST_P ( AvmRecursiveTestsParameterized  ,
GoblinRecursion   
)

A test of the Goblinized AVM recursive verifier.

Constructs a simple AVM circuit for which a proof is verified using the Goblinized AVM recursive verifier. A proof is constructed and verified for the outer (Ultra) circuit produced by this algorithm. See the documentation in AvmGoblinRecursiveVerifier for details of the recursive verification algorithm.

When pad_proof=true (Padded variant), the proof is padded to AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED to match production behavior where TypeScript pads the proof before passing it to noir circuits.

Definition at line 73 of file recursive_verifier.test.cpp.