|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <test_class.hpp>
Public Types | |
| using | Builder = Base::Builder |
| using | AcirConstraint = Base::AcirConstraint |
| using | InvalidWitness = Base::InvalidWitness |
| using | InvalidWitnessTarget = Base::InvalidWitness::Target |
Static Public Member Functions | |
| static std::pair< AcirConstraint, WitnessVector > | generate_constraints (const InvalidWitnessTarget &invalid_witness_target=InvalidWitnessTarget::None) |
| Generate constraints and witness values based on the invalidation target. | |
| static std::tuple< bool, bool, std::string > | test_constraints (const InvalidWitnessTarget &invalid_witness_target) |
| General purpose testing function. It generates the test based on the predicate and invalidation target. | |
| template<typename Flavor > | |
| static size_t | test_vk_independence () |
| Test vk generation is independent of the witness values supplied. | |
| static std::vector< std::string > | test_tampering () |
| Test all invalid witness targets. | |
Definition at line 558 of file test_class.hpp.
| using acir_format::TestClass< Base >::AcirConstraint = Base::AcirConstraint |
Definition at line 561 of file test_class.hpp.
| using acir_format::TestClass< Base >::Builder = Base::Builder |
Definition at line 560 of file test_class.hpp.
| using acir_format::TestClass< Base >::InvalidWitness = Base::InvalidWitness |
Definition at line 562 of file test_class.hpp.
| using acir_format::TestClass< Base >::InvalidWitnessTarget = Base::InvalidWitness::Target |
Definition at line 563 of file test_class.hpp.
|
inlinestatic |
Generate constraints and witness values based on the invalidation target.
Definition at line 568 of file test_class.hpp.
|
inlinestatic |
General purpose testing function. It generates the test based on the predicate and invalidation target.
In a real flow, we have: Noir --> ACIR --> Bytes --> AcirFormat (via circuit_buf_to_acir_format) --> Builder We simulate the above flow by generating an AcirConstraint (one of the constraints stored in an AcirFormat struct), rewinding it into its Acir::Opcode form (which is the output of the byte deserialization step in the diagram above), and then feeding it into circuit_serde_to_acir_format as an Acir::Circuit with a single opcode. The function circuit_buf_to_acir_format internally calls circuit_serde_to_acir_format after having deserialized the byte buffer to an Acir::Circuit, so the flow in this test is the same as the real flow, minus the byte serialization/deserialization. The rationale for doing the rewinding is ensuring that barretenberg internally tests circuit_serde_to_acir_format, which would otherwise only be tested via the tests in acir_tests.
Definition at line 596 of file test_class.hpp.
|
inlinestatic |
Test all invalid witness targets.
Definition at line 664 of file test_class.hpp.
|
inlinestatic |
Test vk generation is independent of the witness values supplied.
This function tests that the verification key is deterministic and independent of the witness values by going through the full ACIR flow.
| Flavor |
Definition at line 618 of file test_class.hpp.