69 const Fr& nu_challenge,
70 const Fr& r_challenge)
72 const Fr& inverse_vanishing_eval_pos = inverted_vanishing_evals[0];
73 const Fr& inverse_vanishing_eval_neg = inverted_vanishing_evals[1];
77 unshifted->scalar = inverse_vanishing_eval_pos + nu_challenge * inverse_vanishing_eval_neg;
82 r_challenge.invert() * (inverse_vanishing_eval_pos - nu_challenge * inverse_vanishing_eval_neg);
96 std::vector<Fr>& scalars,
97 Fr& batched_evaluation,
100 size_t num_powers = 0;
102 num_powers +=
shifted.has_value() ?
shifted->commitments.size() : 0;
104 Fr rho_power =
Fr(1);
105 size_t power_idx = 0;
109 auto aggregate_claim_data_and_update_batched_evaluation = [&](
const Batch& batch) {
110 for (
auto [commitment, evaluation] :
zip_view(batch.commitments, batch.evaluations)) {
111 commitments.emplace_back(
std::move(commitment));
112 scalars.emplace_back(-batch.scalar * rho_power);
113 batched_evaluation += evaluation * rho_power;
115 if (power_idx < num_powers) {
125 aggregate_claim_data_and_update_batched_evaluation(*
unshifted);
129 aggregate_claim_data_and_update_batched_evaluation(*
shifted);
#define BB_ASSERT_EQ(actual, expected,...)
A template class for a reference vector. Behaves as if std::vector<T&> was possible.
typename Group::affine_element AffineElement
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
RefVector< Commitment > commitments
RefVector< Fr > evaluations
Logic to support batching opening claims for unshifted and shifted polynomials in Shplemini.
std::optional< Batch > unshifted
void update_batch_mul_inputs_and_batched_evaluation(std::vector< Commitment > &commitments, std::vector< Fr > &scalars, Fr &batched_evaluation, const Fr &rho)
Append the commitments and scalars from each batch of claims to the Shplemini vectors which subsequen...
std::optional< Batch > shifted
void compute_scalars_for_each_batch(std::span< const Fr > inverted_vanishing_evals, const Fr &nu_challenge, const Fr &r_challenge)
Compute scalars used to batch each set of claims, excluding contribution from batching challenge \rho...
typename Curve::ScalarField Fr
Fr get_unshifted_batch_scalar() const
typename Curve::AffineElement Commitment