Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "barretenberg/client_ivc/client_ivc.hpp"
#include "barretenberg/client_ivc/mock_circuit_producer.hpp"
#include "barretenberg/client_ivc/test_bench_shared.hpp"
#include "barretenberg/common/assert.hpp"
#include "barretenberg/common/mem.hpp"
#include "barretenberg/common/test.hpp"
#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp"
#include "barretenberg/goblin/goblin.hpp"
#include "barretenberg/goblin/mock_circuits.hpp"
#include "barretenberg/protogalaxy/folding_test_utils.hpp"
#include "barretenberg/serialize/msgpack_impl.hpp"
#include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp"
#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp"
#include "gtest/gtest.h"
Go to the source code of this file.
Classes | |
class | ClientIVCTests |
Functions | |
TEST_F (ClientIVCTests, BasicStructured) | |
Using a structured trace allows for the accumulation of circuits of varying size. | |
TEST_F (ClientIVCTests, BadProofFailure) | |
Check that the IVC fails if an intermediate fold proof is invalid. | |
TEST_F (ClientIVCTests, WrongProofComponentFailure) | |
Produce 2 valid CIVC proofs. Ensure that replacing a proof component with a component from a different proof leads to a verification failure. | |
TEST_F (ClientIVCTests, VKIndependenceTest) | |
Ensure that the CIVC VK is independent of the number of circuits accumulated. | |
TEST_F (ClientIVCTests, VKIndependenceWithOverflow) | |
Ensure that the CIVC VK is independent of whether any of the circuits being accumulated overflows the structured trace. | |
HEAVY_TEST (ClientIVCKernelCapacity, MaxCapacityPassing) | |
Test to establish the "max" number of apps that can be accumulated due to limitations on the ECCVM size. | |
TEST_F (ClientIVCTests, StructuredTraceOverflow) | |
Test use of structured trace overflow block mechanism. | |
TEST_F (ClientIVCTests, DynamicTraceOverflow) | |
Test the structured trace overflow mechanism in a variety of different scenarios. | |
TEST_F (ClientIVCTests, MsgpackProofFromFileOrBuffer) | |
Test methods for serializing and deserializing a proof to/from a file/buffer in msgpack format. | |
TEST_F (ClientIVCTests, DatabusFailure) | |
Demonstrate that a databus inconsistency leads to verification failure for the IVC. | |
HEAVY_TEST | ( | ClientIVCKernelCapacity | , |
MaxCapacityPassing | |||
) |
Test to establish the "max" number of apps that can be accumulated due to limitations on the ECCVM size.
Definition at line 281 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
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 99 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
BasicStructured | |||
) |
Using a structured trace allows for the accumulation of circuits of varying size.
Definition at line 84 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
DatabusFailure | |||
) |
Demonstrate that a databus inconsistency leads to verification failure for the IVC.
Kernel circuits contain databus consistency checks that establish that data was passed faithfully between circuits, e.g. the output (return_data) of an app was the input (secondary_calldata) of a kernel. This test tampers with the databus in such a way that one of the kernels receives secondary_calldata based on tampered app return data. This leads to an invalid witness in the check that ensures that the two corresponding commitments are equal and thus causes failure of the IVC to verify.
Definition at line 406 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
DynamicTraceOverflow | |||
) |
Test the structured trace overflow mechanism in a variety of different scenarios.
Definition at line 323 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
MsgpackProofFromFileOrBuffer | |||
) |
Test methods for serializing and deserializing a proof to/from a file/buffer in msgpack format.
Definition at line 360 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
StructuredTraceOverflow | |||
) |
Test use of structured trace overflow block mechanism.
Accumulate 4 circuits which have progressively more arithmetic gates. The final two overflow the prescribed arithmetic block size and make use of the overflow block which has sufficient capacity.
Definition at line 298 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
VKIndependenceTest | |||
) |
Ensure that the CIVC VK is independent of the number of circuits accumulated.
Definition at line 228 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
VKIndependenceWithOverflow | |||
) |
Ensure that the CIVC VK is independent of whether any of the circuits being accumulated overflows the structured trace.
If one of the circuits being accumulated overflows the structured trace, the dyadic size of the accumulator may increase. In this case we want to ensure that the CIVC VK (and in particular the hiding circuit VK) is identical to the non-overflow case. This requires, for example, that the padding_indicator_array logic used in somecheck is functioning properly.
Definition at line 253 of file client_ivc.test.cpp.
TEST_F | ( | ClientIVCTests | , |
WrongProofComponentFailure | |||
) |
Produce 2 valid CIVC proofs. Ensure that replacing a proof component with a component from a different proof leads to a verification failure.
Definition at line 174 of file client_ivc.test.cpp.