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

Go to the source code of this file.

Classes

class  ChonkTests
 

Functions

 TEST_F (ChonkTests, TestCircuitSizes)
 Test sizes of the circuits generated by MockCircuitProducer.
 
 TEST_F (ChonkTests, Basic)
 Test basic IVC.
 
 TEST_F (ChonkTests, BadProofFailure)
 Check that the IVC fails if an intermediate fold proof is invalid.
 
 TEST_F (ChonkTests, VKIndependenceFromNumberOfCircuits)
 Ensure that the hiding kernel VK is independent of the number of circuits accumulated.
 
 TEST_F (ChonkTests, VKIndependenceFromCircuitSize)
 Ensure that the hiding kernel VK is independent of the sizes of the circuits being accumulated.
 
 HEAVY_TEST (ChonkKernelCapacity, MaxCapacityPassing)
 Test to establish the "max" number of apps that can be accumulated due to limitations on the ECCVM size.
 
 TEST_F (ChonkTests, MsgpackProofFromFileOrBuffer)
 Test methods for serializing and deserializing a proof to/from a file/buffer in msgpack format.
 
 TEST_F (ChonkTests, KernelPairingInputsTamperingFailure)
 Test that tampering with kernel pairing inputs causes verification to fail.
 
 TEST_F (ChonkTests, AppPairingInputsTamperingFailure)
 Test that tampering with app pairing inputs causes verification to fail.
 
 TEST_F (ChonkTests, AccumulatorHashTamperingFailure)
 Verify that tampering with the accumulator hash in public inputs causes IVC verification failure.
 
 TEST_F (ChonkTests, KernelReturnDataTamperingFailure)
 Test that tampering with kernel_return_data causes verification to fail.
 
 TEST_F (ChonkTests, AppReturnDataTamperingFailure)
 Test that tampering with app_return_data causes verification to fail.
 
 TEST_F (ChonkTests, EccOpTablesTamperingFailure)
 Test that tampering with ecc_op_tables causes verification to fail.
 
 TEST_F (ChonkTests, PairingPointsPropagationConsistency)
 Test that pairing points are consistently propagated from Tail kernel to HidingKernel proof.
 
 TEST_F (ChonkTests, KernelReturnDataPropagationConsistency)
 Test that kernel_return_data is consistently propagated from Tail kernel to HidingKernel proof.
 
 TEST_F (ChonkTests, MTailPropagationConsistency)
 Test that M_tail is consistently propagated from Tail kernel to HidingKernel proof.
 

Function Documentation

◆ HEAVY_TEST()

HEAVY_TEST ( ChonkKernelCapacity  ,
MaxCapacityPassing   
)

Test to establish the "max" number of apps that can be accumulated due to limitations on the ECCVM size.

Definition at line 424 of file chonk.test.cpp.

◆ TEST_F() [1/15]

TEST_F ( ChonkTests  ,
AccumulatorHashTamperingFailure   
)

Verify that tampering with the accumulator hash in public inputs causes IVC verification failure.

Each kernel outputs output_hn_accum_hash as a public input. The next kernel computes the hash of its input accumulator and compares it with the hash from the previous kernel's public inputs via assert_equal. This test tampers with the hash to verify the binding.

Definition at line 502 of file chonk.test.cpp.

◆ TEST_F() [2/15]

TEST_F ( ChonkTests  ,
AppPairingInputsTamperingFailure   
)

Test that tampering with app pairing inputs causes verification to fail.

App circuits also output pairing points (AppIO). This test ensures that verification fails if we double these pairing points.

Definition at line 491 of file chonk.test.cpp.

◆ TEST_F() [3/15]

TEST_F ( ChonkTests  ,
AppReturnDataTamperingFailure   
)

Test that tampering with app_return_data causes verification to fail.

app_return_data is the commitment to the app's return data which must match the secondary_calldata commitment of the next circuit.

Definition at line 522 of file chonk.test.cpp.

◆ TEST_F() [4/15]

TEST_F ( ChonkTests  ,
BadProofFailure   
)

Check that the IVC fails if an intermediate fold proof is invalid.

When accumulating 4 circuits, there are 3 fold proofs to verify (the first two are recursively verfied and the 3rd is verified as part of the IVC proof). Check that if any of one of these proofs is invalid, the IVC will fail.

Definition at line 312 of file chonk.test.cpp.

◆ TEST_F() [5/15]

TEST_F ( ChonkTests  ,
Basic   
)

Test basic IVC.

Note
The circuits are of varying size: first circuit is 2^19, kernels are 2^18, apps are 2^17.

Definition at line 297 of file chonk.test.cpp.

◆ TEST_F() [6/15]

TEST_F ( ChonkTests  ,
EccOpTablesTamperingFailure   
)

Test that tampering with ecc_op_tables causes verification to fail.

ecc_op_tables contains commitments to merged ECC operation tables (T_prev). Tampering causes the recursive merge verification to fail.

Definition at line 532 of file chonk.test.cpp.

◆ TEST_F() [7/15]

TEST_F ( ChonkTests  ,
KernelPairingInputsTamperingFailure   
)

Test that tampering with kernel pairing inputs causes verification to fail.

Pairing points (P0, P1) accumulate across the IVC chain through aggregation. Even if we replace them with pairing points satisfying pairing check, the public input binding should must catch it.

Definition at line 481 of file chonk.test.cpp.

◆ TEST_F() [8/15]

TEST_F ( ChonkTests  ,
KernelReturnDataPropagationConsistency   
)

Test that kernel_return_data is consistently propagated from Tail kernel to HidingKernel proof.

kernel_return_data commitment is placed in the Tail kernel's public inputs and must be propagated unchanged to the HidingKernel's public inputs.

Definition at line 553 of file chonk.test.cpp.

◆ TEST_F() [9/15]

TEST_F ( ChonkTests  ,
KernelReturnDataTamperingFailure   
)

Test that tampering with kernel_return_data causes verification to fail.

kernel_return_data is the commitment to the kernel's return data which must match the calldata commitment of the next circuit. Tampering should cause databus consistency check to fail.

Definition at line 512 of file chonk.test.cpp.

◆ TEST_F() [10/15]

TEST_F ( ChonkTests  ,
MsgpackProofFromFileOrBuffer   
)

Test methods for serializing and deserializing a proof to/from a file/buffer in msgpack format.

Definition at line 439 of file chonk.test.cpp.

◆ TEST_F() [11/15]

TEST_F ( ChonkTests  ,
MTailPropagationConsistency   
)

Test that M_tail is consistently propagated from Tail kernel to HidingKernel proof.

M_tail (ecc_op_tables) commitments are placed in the Tail kernel's public inputs and must be propagated unchanged to the HidingKernel's public inputs.

Definition at line 563 of file chonk.test.cpp.

◆ TEST_F() [12/15]

TEST_F ( ChonkTests  ,
PairingPointsPropagationConsistency   
)

Test that pairing points are consistently propagated from Tail kernel to HidingKernel proof.

Pairing points (P0, P1) accumulate across all circuits in the IVC chain via aggregation. The aggregated pairing points are placed in the Tail kernel's public inputs and must be propagated unchanged to the HidingKernel's public inputs.

Definition at line 543 of file chonk.test.cpp.

◆ TEST_F() [13/15]

TEST_F ( ChonkTests  ,
TestCircuitSizes   
)

Test sizes of the circuits generated by MockCircuitProducer.

The sizes of the circuits depends on the TestSettings:

  • No settings: first app is 2^19, all other apps are 2^17, all the kernels are 2^18
  • Settings: apps are 2^(log2_num_gates + 2), all kernels are smaller than 2^19

Definition at line 273 of file chonk.test.cpp.

◆ TEST_F() [14/15]

TEST_F ( ChonkTests  ,
VKIndependenceFromCircuitSize   
)

Ensure that the hiding kernel VK is independent of the sizes of the circuits being accumulated.

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

◆ TEST_F() [15/15]

TEST_F ( ChonkTests  ,
VKIndependenceFromNumberOfCircuits   
)

Ensure that the hiding kernel VK is independent of the number of circuits accumulated.

Definition at line 388 of file chonk.test.cpp.