|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
CommitmentKey object over a pairing group 𝔾₁. More...
#include <commitment_key.hpp>
Classes | |
| struct | CommitBatch |
Public Member Functions | |
| CommitmentKey ()=default | |
| CommitmentKey (const size_t num_points) | |
| Construct a new Kate Commitment Key object from existing SRS. | |
| bool | initialized () const |
| Checks the commitment key is properly initialized. | |
| std::span< Commitment > | get_monomial_points () const |
| size_t | get_monomial_size () const |
| Commitment | commit (PolynomialSpan< const Fr > polynomial, bool has_duplicates_hint=false) const |
| Uses the ProverSRS to create a commitment to p(X) | |
| std::vector< Commitment > | batch_commit (RefSpan< Polynomial< Fr > > polynomials, std::span< const uint32_t > dedup_infos={}) const |
| Batch commitment to multiple polynomials. | |
| CommitBatch | start_batch () |
Static Public Member Functions | |
| static constexpr size_t | round_up_to_even (size_t n) |
Public Attributes | |
| size_t | srs_size |
Protected Attributes | |
| std::shared_ptr< srs::factories::Crs< Curve > > | srs |
Private Types | |
| using | Fr = typename Curve::ScalarField |
| using | Commitment = typename Curve::AffineElement |
CommitmentKey object over a pairing group 𝔾₁.
Commitments are computed as C = [p(x)] = ∑ᵢ aᵢ⋅Gᵢ where Gᵢ is the i-th element of the SRS. For BN254, the SRS is given as a list of 𝔾₁ points { [xʲ]₁ }ⱼ where 'x' is unknown. For Grumpkin, they are random points. The SRS stored in the commitment key is after applying the pippenger_point_table thus being double the size of what is loaded from path.
Definition at line 39 of file commitment_key.hpp.
|
private |
Definition at line 42 of file commitment_key.hpp.
|
private |
Definition at line 41 of file commitment_key.hpp.
|
default |
|
inline |
Construct a new Kate Commitment Key object from existing SRS.
| num_points | Number of points needed for commitments. Always rounded up to the next even value so that callers which need one extra SRS point (e.g. sparse masking polynomials that round their top pair up to an even index) always fit. |
Definition at line 61 of file commitment_key.hpp.
|
inline |
Batch commitment to multiple polynomials.
Uses batch_multi_scalar_mul for more efficient processing when committing to multiple polynomials. The input polynomials are not const because batch_mul modifies them and then restores them back.
| polynomials | vector of polynomial spans to commit to |
| has_duplicates_hints | optional per-polynomial hints (parallel to polynomials): a non-zero entry opts that polynomial's MSM into the dedup pre-pass. |
Definition at line 104 of file commitment_key.hpp.
|
inline |
Uses the ProverSRS to create a commitment to p(X)
| polynomial | a univariate polynomial p(X) = ∑ᵢ aᵢ⋅Xⁱ |
Definition at line 81 of file commitment_key.hpp.
|
inline |
Definition at line 72 of file commitment_key.hpp.
|
inline |
Definition at line 73 of file commitment_key.hpp.
|
inline |
Checks the commitment key is properly initialized.
Definition at line 70 of file commitment_key.hpp.
|
inlinestaticconstexpr |
Definition at line 52 of file commitment_key.hpp.
|
inline |
Definition at line 158 of file commitment_key.hpp.
|
protected |
Definition at line 45 of file commitment_key.hpp.
| size_t bb::CommitmentKey< Curve >::srs_size |
Definition at line 48 of file commitment_key.hpp.