|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <kzg.hpp>
Public Types | |
| using | Curve = Curve_ |
| using | CK = CommitmentKey< Curve > |
| using | VK = VerifierCommitmentKey< Curve > |
| using | Fr = typename Curve::ScalarField |
| using | Commitment = typename Curve::AffineElement |
| using | GroupElement = typename Curve::Element |
| using | Polynomial = bb::Polynomial< Fr > |
| using | PairingPointsType = std::conditional_t< Curve::is_stdlib_type, stdlib::recursion::PairingPoints< Curve >, bb::PairingPoints< Curve > > |
Static Public Member Functions | |
| template<typename Transcript > | |
| static void | compute_opening_proof (const CK &ck, const ProverOpeningClaim< Curve > &opening_claim, const std::shared_ptr< Transcript > &prover_trancript) |
| Computes the KZG commitment to an opening proof polynomial at a single evaluation point. | |
| template<typename Transcript > | |
| static PairingPointsType | reduce_verify (const OpeningClaim< Curve > &claim, const std::shared_ptr< Transcript > &verifier_transcript) |
| Computes the input points for the pairing check needed to verify a KZG opening claim of a single polynomial commitment. This reduction is non-interactive and always succeeds. | |
| template<typename Transcript > | |
| static PairingPointsType | reduce_verify_batch_opening_claim (BatchOpeningClaim< Curve > &&batch_opening_claim, const std::shared_ptr< Transcript > &transcript, const size_t expected_final_msm_size=0) |
| Computes the input points for the pairing check needed to verify a KZG opening claim obtained from a Shplemini accumulator. | |
| using bb::KZG< Curve_ >::CK = CommitmentKey<Curve> |
| using bb::KZG< Curve_ >::Commitment = typename Curve::AffineElement |
| using bb::KZG< Curve_ >::Fr = typename Curve::ScalarField |
| using bb::KZG< Curve_ >::GroupElement = typename Curve::Element |
| using bb::KZG< Curve_ >::PairingPointsType = std::conditional_t<Curve::is_stdlib_type, stdlib::recursion::PairingPoints<Curve>, bb::PairingPoints<Curve> > |
| using bb::KZG< Curve_ >::Polynomial = bb::Polynomial<Fr> |
| using bb::KZG< Curve_ >::VK = VerifierCommitmentKey<Curve> |
|
inlinestatic |
Computes the KZG commitment to an opening proof polynomial at a single evaluation point.
| ck | The commitment key which has a commit function, the srs and pippenger_runtime_state |
| opening_claim | {p, (r, v = p(r))} where p is the witness polynomial whose opening proof needs to be computed |
| prover_transcript | Prover transcript |
|
inlinestatic |
Computes the input points for the pairing check needed to verify a KZG opening claim of a single polynomial commitment. This reduction is non-interactive and always succeeds.
This is used in the recursive setting where we want to "aggregate" proofs, not verify them.
| claim | OpeningClaim ({r, v}, C) |
|
inlinestatic |
Computes the input points for the pairing check needed to verify a KZG opening claim obtained from a Shplemini accumulator.
This function is used in a recursive setting where we want to "aggregate" proofs. In the Shplemini case, the commitment \( C \) is encoded into the vectors commitments and scalars contained in the batch_opening_claim. More explicitly, \( C = \sum \text{commitments}_i \cdot \text{scalars}_i \). To avoid performing an extra batch_mul, we simply add the commitment \( [W]_1 \) to the vector of commitments and the Shplonk evaluation challenge to the vector of scalars and perform a single batch_mul that computes \(C +
W\cdot z \).
| batch_opening_claim | \((\text{commitments}, \text{scalars}, \text{shplonk_evaluation_challenge})\) A struct containing the commitments, scalars, and the Shplonk evaluation challenge. |
| expected_final_msm_size | Optional expected size of the final MSM (after adding quotient commitment). If non-zero, asserts that the finalized claim has this exact size. Use Flavor::FINAL_PCS_MSM_SIZE. |