|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "ultra_honk.test.hpp"#include "barretenberg/honk/proof_length.hpp"#include "barretenberg/honk/relation_checker.hpp"#include <gtest/gtest.h>Go to the source code of this file.
Typedefs | |
| using | AggregationState = stdlib::recursion::PairingPoints< UltraCircuitBuilder > |
| using | FlavorTypes = testing::Types< UltraFlavor, UltraZKFlavor, UltraKeccakFlavor, UltraKeccakZKFlavor > |
Functions | |
| TYPED_TEST_SUITE (UltraHonkTests, FlavorTypes) | |
| TYPED_TEST (UltraHonkTests, ProofLengthCheck) | |
| Check that size of a ultra honk proof matches the corresponding constant. | |
| TYPED_TEST (UltraHonkTests, ANonZeroPolynomialIsAGoodPolynomial) | |
| A quick test to ensure that none of our polynomials are identically zero. | |
| TYPED_TEST (UltraHonkTests, PublicInputs) | |
| Test simple circuit with public inputs. | |
| TYPED_TEST (UltraHonkTests, TestNoLookupProof) | |
| TYPED_TEST (UltraHonkTests, TestEllipticGate) | |
| TYPED_TEST (UltraHonkTests, NonNativeFieldMultiplication) | |
| TYPED_TEST (UltraHonkTests, RangeChecksOnDuplicates) | |
| TYPED_TEST (UltraHonkTests, RangeConstraintSmallVariable) | |
| TYPED_TEST (UltraHonkTests, NativeVKHashMismatchDetected) | |
| Test that native verifier detects VK hash mismatch. | |
| TYPED_TEST (UltraHonkTests, TooShortProofRejected) | |
| Test that a truncated proof is rejected with a clear error message. | |
| TYPED_TEST (UltraHonkTests, TooLongProofRejected) | |
| Test that a proof with extra elements appended is rejected. | |
| TYPED_TEST (UltraHonkTests, DyadicSizeJumpsToProtectMaskingArea) | |
| Test that the dyadic size correctly jumps to the next power of 2 when the trace would otherwise place lagrange_last in the ZK masking region. | |
Definition at line 9 of file ultra_honk.test.cpp.
| using FlavorTypes = testing::Types<UltraFlavor, UltraZKFlavor, UltraKeccakFlavor, UltraKeccakZKFlavor> |
Definition at line 19 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| ANonZeroPolynomialIsAGoodPolynomial | |||
| ) |
A quick test to ensure that none of our polynomials are identically zero.
Definition at line 58 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| DyadicSizeJumpsToProtectMaskingArea | |||
| ) |
Test that the dyadic size correctly jumps to the next power of 2 when the trace would otherwise place lagrange_last in the ZK masking region.
For ZK flavors, the last NUM_MASKED_ROWS rows are overwritten with random values for zero-knowledge. We incrementally add gates until the dyadic size doubles, verifying at each step that: (1) lagrange_last (at final_active_wire_idx) does not overlap the masking area (2) sufficient headroom exists for disabled rows (3) at the boundary, the dyadic size doubles because the previous power of 2 was too small At the tightest packing (right before the jump), we also prove-and-verify.
Definition at line 418 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| NativeVKHashMismatchDetected | |||
| ) |
Test that native verifier detects VK hash mismatch.
The VKAndHash stores a precomputed hash of the VK. During verification, the oink verifier computes a fresh hash and compares it. If they don't match, a BB_ASSERT_EQ should trigger, catching potential VK tampering or corruption.
Definition at line 299 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| NonNativeFieldMultiplication | |||
| ) |
Definition at line 164 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| ProofLengthCheck | |||
| ) |
Check that size of a ultra honk proof matches the corresponding constant.
If this test FAILS, then the following (non-exhaustive) list should probably be updated as well:
Definition at line 31 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| PublicInputs | |||
| ) |
Test simple circuit with public inputs.
Definition at line 94 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| RangeChecksOnDuplicates | |||
| ) |
Definition at line 231 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| RangeConstraintSmallVariable | |||
| ) |
Definition at line 272 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| TestEllipticGate | |||
| ) |
Definition at line 129 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| TestNoLookupProof | |||
| ) |
Definition at line 106 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| TooLongProofRejected | |||
| ) |
Test that a proof with extra elements appended is rejected.
When a proof is too long, the derived num_public_inputs will be wrong, causing a mismatch with the VK's expected value.
Definition at line 373 of file ultra_honk.test.cpp.
| TYPED_TEST | ( | UltraHonkTests | , |
| TooShortProofRejected | |||
| ) |
Test that a truncated proof is rejected with a clear error message.
When a proof is too short, the verifier should detect this before unsigned integer underflow occurs in derive_num_public_inputs.
Definition at line 337 of file ultra_honk.test.cpp.
| TYPED_TEST_SUITE | ( | UltraHonkTests | , |
| FlavorTypes | |||
| ) |