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

Go to the source code of this file.

Classes

class  TranslatorTests
 

Typedefs

using CircuitBuilder = TranslatorFlavor::CircuitBuilder
 
using Transcript = TranslatorFlavor::Transcript
 
using OpQueue = ECCOpQueue
 

Functions

TranslatorFlavor::VerificationKey create_vk_from_proving_key (const std::shared_ptr< TranslatorFlavor::ProvingKey > &proving_key)
 
TranslatorFlavor::FF compute_translator_vk_hash ()
 
 TEST_F (TranslatorTests, ProofLengthCheck)
 Check that size of a Translator proof matches the corresponding constant.
 
 TEST_F (TranslatorTests, Basic)
 Test simple circuit with public inputs.
 
 TEST_F (TranslatorTests, BasicAvmMode)
 Test Translator operates correctly for AVM i.e. when we only run Goblin on a single table of ecc ops and we should not expect random ops to appear at the end of Translator trace.
 
 TEST_F (TranslatorTests, FixedVK)
 Ensure that the fixed VK from the default constructor agrees with those computed manually for an arbitrary circuit.
 
 TEST_F (TranslatorTests, TranscriptPinned)
 Pin the Translator transcript manifest.
 
 TEST_F (TranslatorTests, EvaluationPartition)
 Unit test for concatenated polynomial construction and reconstruction.
 
 TEST_F (TranslatorTests, RepeatedCommitmentsIndicesCorrect)
 Verify that the verifier-side methods populate every entity in AllEntities.
 
 TEST_F (TranslatorTests, VerifierPopulatesAllEntities)
 

Typedef Documentation

◆ CircuitBuilder

◆ OpQueue

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

◆ Transcript

Definition at line 15 of file translator.test.cpp.

Function Documentation

◆ compute_translator_vk_hash()

TranslatorFlavor::FF compute_translator_vk_hash ( )

Definition at line 31 of file translator.test.cpp.

◆ create_vk_from_proving_key()

TranslatorFlavor::VerificationKey create_vk_from_proving_key ( const std::shared_ptr< TranslatorFlavor::ProvingKey > &  proving_key)

Definition at line 20 of file translator.test.cpp.

◆ TEST_F() [1/8]

TEST_F ( TranslatorTests  ,
Basic   
)

Test simple circuit with public inputs.

Definition at line 286 of file translator.test.cpp.

◆ TEST_F() [2/8]

TEST_F ( TranslatorTests  ,
BasicAvmMode   
)

Test Translator operates correctly for AVM i.e. when we only run Goblin on a single table of ecc ops and we should not expect random ops to appear at the end of Translator trace.

Definition at line 306 of file translator.test.cpp.

◆ TEST_F() [3/8]

TEST_F ( TranslatorTests  ,
EvaluationPartition   
)

Unit test for concatenated polynomial construction and reconstruction.

Tests that:

  1. Concatenated polynomials are correctly constructed from wire polynomials
  2. The verifier's reconstruction formula correctly recovers the concatenated evaluation

Sanity check that minicircuit wires + full-circuit entities + computable precomputed partition all 192 entities without overlap or gaps.

The sumcheck helpers split AllEntities into three groups for mid-sumcheck sending:

  • get_minicircuit_wires() : 77 unshifted minicircuit wires
  • get_minicircuit_wires_shifted() : 77 shifted minicircuit wires
  • get_full_circuit_entities() : 26 full-circuit entities
  • compute_computable_precomputed : 12 computable precomputed selectors Total: 77 + 77 + 26 + 12 = 192 = NUM_ALL_ENTITIES

Definition at line 461 of file translator.test.cpp.

◆ TEST_F() [4/8]

TEST_F ( TranslatorTests  ,
FixedVK   
)

Ensure that the fixed VK from the default constructor agrees with those computed manually for an arbitrary circuit.

Note
If this test fails, it may be because the constant CONST_TRANSLATOR_LOG_N has changed and the fixed VK commitments in TranslatorHardcodedVKAndHash must be updated accordingly. Their values can be taken right from the output of this test.

Definition at line 335 of file translator.test.cpp.

◆ TEST_F() [5/8]

TEST_F ( TranslatorTests  ,
ProofLengthCheck   
)

Check that size of a Translator proof matches the corresponding constant.

If this test FAILS, then the following (non-exhaustive) list should probably be updated as well:

  • Proof length formula in translator_flavor.hpp, etc...
  • translator_transcript.test.cpp
  • constants in yarn-project in: constants.nr, constants.gen.ts, ConstantsGen.sol

Definition at line 259 of file translator.test.cpp.

◆ TEST_F() [6/8]

TEST_F ( TranslatorTests  ,
RepeatedCommitmentsIndicesCorrect   
)

Verify that the verifier-side methods populate every entity in AllEntities.

Start from all-zeros, call set_minicircuit_evaluations + complete_full_circuit_evaluations with random inputs, and check that no entity remains zero (with overwhelming probability).

Verify that REPEATED_COMMITMENTS indices correctly pair to-be-shifted and shifted commitments.

The Translator has two duplicate ranges and uses get_pcs_unshifted()/get_pcs_to_be_shifted() instead of the standard get_unshifted()/get_to_be_shifted(). This test commits to all PCS-level polynomials and verifies the commitments at original and duplicate positions match.

Definition at line 526 of file translator.test.cpp.

◆ TEST_F() [7/8]

TEST_F ( TranslatorTests  ,
TranscriptPinned   
)

Pin the Translator transcript manifest.

Verifies that the verifier transcript matches the expected hardcoded structure. Prover correctness follows by transitivity (prover/verifier must match for verification to succeed).

Definition at line 393 of file translator.test.cpp.

◆ TEST_F() [8/8]

TEST_F ( TranslatorTests  ,
VerifierPopulatesAllEntities   
)

Definition at line 574 of file translator.test.cpp.