|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Public Types | |
| enum class | TamperedPolynomial : size_t { None = SIZE_MAX , Concatenated = 0 , GrandSum = 1 , Quotient = 2 } |
| enum class | TamperedCommitment : size_t { None = SIZE_MAX , Concatenated = 0 , GrandSum = 1 , Quotient = 2 } |
| using | Fr = typename Flavor::Curve::ScalarField |
| using | GroupElement = typename Flavor::Curve::Element |
| using | Commitment = typename Flavor::Curve::AffineElement |
| using | CK = typename Flavor::CommitmentKey |
Public Member Functions | |
| Fr | run_forged_small_ipa_prover (const std::shared_ptr< typename Flavor::Transcript > &prover_transcript, CK &ck, ZKSumcheckData< Flavor > &zk_sumcheck_data, std::vector< Fr > &mle_opening_point, MockClaimGenerator< typename Flavor::Curve > &mock_claims, const Fr &honest_inner_product) |
| Simulated malicious prover for the Shplemini + SmallSubgroupIPA soundness regression. | |
Public Member Functions inherited from bb::CommitmentTest< Flavor::Curve > | |
| CommitmentTest () | |
| const CK & | ck () |
| VK & | vk () |
| Commitment | commit (const Polynomial &polynomial) |
| Fr | random_element () |
| Polynomial | random_polynomial (const size_t poly_size) |
| OpeningPair< Flavor::Curve > | random_eval (const Polynomial &polynomial) |
| std::vector< Fr > | random_evaluation_point (const size_t num_variables) |
| void | verify_opening_claim (const OpeningClaim< Flavor::Curve > &claim, const Polynomial &witness, CommitmentKey< Flavor::Curve > ck=CommitmentKey< Flavor::Curve >()) |
| void | verify_opening_pair (const OpeningPair< Flavor::Curve > &opening_pair, const Polynomial &witness) |
| void | verify_batch_opening_claim (std::span< const OpeningClaim< Flavor::Curve > > multi_claims, std::span< const Polynomial > witnesses) |
| Ensures that a 'BatchOpeningClaim' is correct by checking that. | |
| void | verify_batch_opening_pair (std::vector< ProverOpeningClaim< Flavor::Curve > > opening_claims) |
| Ensures that a set of opening pairs is correct by checking that evaluations are correct by recomputing them from each witness polynomial. | |
| std::vector< UnivariateClaimData< Flavor::Curve > > | generate_claim_data (const std::vector< size_t > &poly_sizes) |
| std::pair< std::vector< Fr >, std::vector< Fr > > | combine_claims (std::vector< UnivariateClaimData< Flavor::Curve > > &claims) |
Static Public Attributes | |
| static constexpr size_t | log_n = 9 |
| static constexpr size_t | n = 1UL << log_n |
| static constexpr size_t | num_polynomials = 7 |
| static constexpr size_t | num_shiftable = 2 |
| static constexpr size_t | sumcheck_univariate_length = 24 |
Static Public Attributes inherited from bb::CommitmentTest< Flavor::Curve > | |
| static CK | commitment_key |
| static VK | verification_key |
Additional Inherited Members | |
Static Public Member Functions inherited from bb::CommitmentTest< Flavor::Curve > | |
| static void | SetUpTestSuite () |
| static void | TearDownTestSuite () |
Public Attributes inherited from bb::CommitmentTest< Flavor::Curve > | |
| numeric::RNG * | engine |
Definition at line 18 of file shplemini.test.cpp.
| using bb::ShpleminiTest< Flavor >::CK = typename Flavor::CommitmentKey |
Definition at line 34 of file shplemini.test.cpp.
| using bb::ShpleminiTest< Flavor >::Commitment = typename Flavor::Curve::AffineElement |
Definition at line 33 of file shplemini.test.cpp.
| using bb::ShpleminiTest< Flavor >::Fr = typename Flavor::Curve::ScalarField |
Definition at line 31 of file shplemini.test.cpp.
| using bb::ShpleminiTest< Flavor >::GroupElement = typename Flavor::Curve::Element |
Definition at line 32 of file shplemini.test.cpp.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Concatenated | |
| GrandSum | |
| Quotient | |
Definition at line 40 of file shplemini.test.cpp.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Concatenated | |
| GrandSum | |
| Quotient | |
Definition at line 37 of file shplemini.test.cpp.
| ShpleminiTest< Flavor >::Fr bb::ShpleminiTest< Flavor >::run_forged_small_ipa_prover | ( | const std::shared_ptr< typename Flavor::Transcript > & | prover_transcript, |
| CK & | ck, | ||
| ZKSumcheckData< Flavor > & | zk_sumcheck_data, | ||
| std::vector< Fr > & | mle_opening_point, | ||
| MockClaimGenerator< typename Flavor::Curve > & | mock_claims, | ||
| const Fr & | honest_inner_product | ||
| ) |
Simulated malicious prover for the Shplemini + SmallSubgroupIPA soundness regression.
The production verifier does not run SmallSubgroupIPA in isolation: it receives the SmallSubgroupIPA commitments/evaluations through the transcript, checks the SmallSubgroupIPA identity, and then relies on Shplemini to PCS-bind those evaluations to the committed witness polynomials. To regression-test the full path, this helper acts as a malicious prover rather than calling the honest SmallSubgroupIPAProver::prove() end to end.
Starting from honest setup data, it tampers the SmallSubgroupIPA witness by constructing forged (A_f, Q_f, s_f) data that still satisfies the local algebraic identity at the random Gemini challenge
L_1(X) A(X) + (X - g^{-1})(A(gX) - A(X) - F(X) G(X)) + L_{|H|}(X)(A(X) - s) = Z_H(X) Q(X)
but does not satisfy the boundary condition expected from an honestly generated grand-sum polynomial. The forging uses the homogeneous perturbation delta_A's Lagrange values on H = (delta, c, c, ..., c) with c = -delta / (g - 1) delta_s = c delta_Q = (L_1*delta_A + (X-g^{-1})(delta_A(gX) - delta_A) + L_{|H|}*(delta_A - delta_s)) / Z_H
The helper writes forged transcript data and commitments for (A_f, Q_f, s_f), then runs ShpleminiProver under BB_DISABLE_ASSERTS so the honest prover's fail-fast exact-division precondition is downgraded to a warning. This lets the test feed the verifier the kind of inconsistent PCS material a malicious prover would submit and check that Shplemini rejects it. Returns the forged inner product so the test can confirm what the verifier is actually fed.
Definition at line 75 of file shplemini.test.cpp.
|
staticconstexpr |
Definition at line 21 of file shplemini.test.cpp.
|
staticconstexpr |
Definition at line 22 of file shplemini.test.cpp.
|
staticconstexpr |
Definition at line 24 of file shplemini.test.cpp.
|
staticconstexpr |
Definition at line 26 of file shplemini.test.cpp.
|
staticconstexpr |
Definition at line 29 of file shplemini.test.cpp.