54 :
srs(
srs::get_crs_factory<
Curve>()->get_crs(num_points))
81 " points with an SRS of size ",
84 return scalar_multiplication::pippenger_unsafe<Curve>(polynomial, point_table);
95 size_t max_batch_size = std::numeric_limits<size_t>::max())
const
102 std::vector<Commitment> commitments;
104 for (
size_t i = 0; i < polynomials.size();) {
106 size_t batch_size = std::min(max_batch_size, polynomials.size() - i);
107 size_t batch_end = i + batch_size;
113 for (
auto& polynomial : polynomials.subspan(i, batch_end - i)) {
115 size_t consumed_srs = polynomial.start_index() + polynomial.size();
119 " points with an SRS of size ",
122 scalar_spans.emplace_back(polynomial.coeffs());
123 points_spans.emplace_back(point_table);
128 for (
const auto& result : results) {
129 commitments.emplace_back(result);
142 size_t max_batch_size = std::numeric_limits<size_t>::max())
145 for (
size_t i = 0; i < commitments.size(); ++i) {
146 transcript->send_to_verifier(
labels[i], commitments[i]);
157 wires.push_back(poly);
#define BB_BENCH_NAME(name)
CommitmentKey object over a pairing group 𝔾₁.
std::vector< Commitment > batch_commit(RefSpan< Polynomial< Fr > > polynomials, size_t max_batch_size=std::numeric_limits< size_t >::max()) const
Batch commitment to multiple polynomials.
size_t get_monomial_size() const
typename Curve::ScalarField Fr
std::span< Commitment > get_monomial_points() const
typename Curve::AffineElement Commitment
CommitmentKey(const size_t num_points)
Construct a new Kate Commitment Key object from existing SRS.
Commitment commit(PolynomialSpan< const Fr > polynomial) const
Uses the ProverSRS to create a commitment to p(X)
bool initialized() const
Checks the commitment key is properly initialized.
std::shared_ptr< srs::factories::Crs< Curve > > srs
CommitBatch start_batch()
Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x .....
void mask()
Add random values to the coefficients of a polynomial. In practice, this is used for ensuring the com...
A template class for a reference vector. Behaves as if std::vector<T&> was possible.
typename Group::affine_element AffineElement
static std::vector< AffineElement > batch_multi_scalar_mul(std::span< std::span< const AffineElement > > points, std::span< std::span< ScalarField > > scalars, bool handle_edge_cases=true) noexcept
Compute multiple multi-scalar multiplications.
std::string format(Args... args)
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::vector< std::string > labels
std::vector< Commitment > commit_and_send_to_verifier(auto transcript, size_t max_batch_size=std::numeric_limits< size_t >::max())
void add_to_batch(Polynomial< Fr > &poly, const std::string &label, bool mask)
RefVector< Polynomial< Fr > > wires
void throw_or_abort(std::string const &err)