Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
multilinear_batching_prover.test.cpp
Go to the documentation of this file.
5
6#include <gtest/gtest.h>
7
8namespace bb {
9namespace {
10
14
15MultilinearBatchingProverClaim create_valid_claim()
16{
18
20
22 for (size_t i = 0; i < MultilinearBatchingFlavor::VIRTUAL_LOG_N; i++) {
23 claim.challenge[i] = FF::random_element();
24 }
25
26 const size_t dyadic_size = 16;
27 claim.non_shifted_polynomial = Polynomial(dyadic_size);
28 claim.shifted_polynomial = Polynomial::shiftable(dyadic_size);
29
31 for (size_t i = 1; i < dyadic_size; i++) {
34 }
35
36 claim.non_shifted_commitment = Commitment::random_element();
37 claim.shifted_commitment = Commitment::random_element();
38
39 auto eq_polynomial = ProverEqPolynomial<FF>::construct(claim.challenge, 4);
40
41 // Compute non-shifted evaluation
42 claim.non_shifted_evaluation = 0;
43 for (size_t i = 0; i < claim.non_shifted_polynomial.size(); i++) {
44 claim.non_shifted_evaluation += claim.non_shifted_polynomial.at(i) * eq_polynomial.at(i);
45 }
46
47 // Compute shifted evaluation using the shifted polynomial
48 auto shifted = claim.shifted_polynomial.shifted();
49 claim.shifted_evaluation = 0;
50 for (size_t i = 0; i < shifted.size(); i++) {
51 claim.shifted_evaluation += shifted.at(i) * eq_polynomial.at(i);
52 }
53
54 claim.dyadic_size = dyadic_size;
55 return claim;
56}
57
58TEST(MultilinearBatchingProver, ConstructProof)
59{
60 auto transcript = std::make_shared<Transcript>();
61 auto accumulator_claim = create_valid_claim();
62 auto instance_claim = create_valid_claim();
63
64 MultilinearBatchingProver prover(std::move(accumulator_claim), std::move(instance_claim), transcript);
65 auto proof = prover.construct_proof();
66 EXPECT_FALSE(proof.empty());
67}
68} // namespace
69} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
Prover for multilinear batching - reduces two polynomial evaluation claims to one via sumcheck.
Structured polynomial class that represents the coefficients 'a' of a_0 + a_1 x .....
Polynomial shifted() const
Returns a Polynomial the left-shift of self.
Fr & at(size_t index)
Our mutable accessor, unlike operator[]. We abuse precedent a bit to differentiate at() and operator[...
static Polynomial shiftable(size_t virtual_size)
Utility to create a shiftable polynomial of given virtual size.
std::size_t size() const
static Polynomial< FF > construct(std::span< const FF > challenges, size_t log_num_monomials)
Construct eq(X, r) coefficient table over Boolean hypercube {0,1}^d.
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
TEST(BoomerangMegaCircuitBuilder, BasicCircuit)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Prover's claim for multilinear batching - contains polynomials and their evaluation claims.
static field random_element(numeric::RNG *engine=nullptr) noexcept