Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
multilinear_batching_claims.cpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
10
11namespace bb {
12
13#ifndef NDEBUG
15 const MultilinearBatchingVerifierClaim<curve::BN254>& verifier_claim) const
16{
17 bool is_a_match = true;
18 bb::CommitmentKey<curve::BN254> bn254_commitment_key(dyadic_size);
19
20 for (size_t idx = 0; auto [prover_challenge, verifier_challenge] : zip_view(challenge, verifier_claim.challenge)) {
21 if (prover_challenge != verifier_challenge) {
22 info("Challenge mismatch at index ", idx);
23 is_a_match = false;
24 }
25 idx++;
26 }
27
28 if (verifier_claim.non_shifted_commitment != bn254_commitment_key.commit(non_shifted_polynomial)) {
29 info("Non-shifted commitment mismatch");
30 is_a_match = false;
31 }
32
33 if (verifier_claim.shifted_commitment != bn254_commitment_key.commit(shifted_polynomial)) {
34 info("Shifted commitment mismatch");
35 is_a_match = false;
36 }
37
38 // Share coefficient storage while using the batching domain size for MLE evaluation.
39 Polynomial non_shifted_polynomial_for_evaluation = non_shifted_polynomial.share();
40 Polynomial shifted_polynomial_for_evaluation = shifted_polynomial.share();
41 non_shifted_polynomial_for_evaluation.increase_virtual_size(1 << challenge.size());
42 shifted_polynomial_for_evaluation.increase_virtual_size(1 << challenge.size());
43
44 if (verifier_claim.non_shifted_evaluation !=
45 non_shifted_polynomial_for_evaluation.evaluate_mle(verifier_claim.challenge)) {
46 info("Non-shifted evaluation mismatch");
47 is_a_match = false;
48 }
49
50 if (verifier_claim.shifted_evaluation !=
51 shifted_polynomial_for_evaluation.evaluate_mle(verifier_claim.challenge, true)) {
52 info("Shifted evaluation mismatch");
53 is_a_match = false;
54 }
55
56 return is_a_match;
57}
58#endif
59
60} // namespace bb
CommitmentKey object over a pairing group 𝔾₁.
Commitment commit(PolynomialSpan< const Fr > polynomial, bool has_duplicates_hint=false) const
Uses the ProverSRS to create a commitment to p(X)
void increase_virtual_size(const size_t size_in)
Fr evaluate_mle(std::span< const Fr > evaluation_points, bool shift=false) const
evaluate multi-linear extension p(X_0,…,X_{n-1}) = \sum_i a_i*L_i(X_0,…,X_{n-1}) at u = (u_0,...
Polynomial share() const
#define info(...)
Definition log.hpp:93
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
bool compare_with_verifier_claim(const MultilinearBatchingVerifierClaim< curve::BN254 > &verifier_claim) const
Debug helper to compare prover claim against verifier claim.
Verifier's claim for multilinear batching - contains commitments and evaluation claims.