Clearmatics Libsnark
0.1
C++ library for zkSNARK proofs
|
#include <kzg10_batched.hpp>
Classes | |
class | evaluation_witness |
class | evaluations |
Public Types | |
using | Field = libff::Fr< ppT > |
using | srs = typename kzg10< ppT >::srs |
using | commitment = typename kzg10< ppT >::commitment |
Static Public Member Functions | |
static evaluations | evaluate_polynomials (const std::vector< polynomial< Field >> &fs, const std::vector< polynomial< Field >> &gs, const Field &z_1, const Field &z_2) |
static evaluation_witness | create_evaluation_witness (const std::vector< polynomial< Field >> &fs, const std::vector< polynomial< Field >> &gs, const Field &z_1, const Field &z_2, const evaluations &evaluations, const srs &srs, const Field &gamma_1, const Field &gamma_2) |
static bool | verify_evaluations (const Field &z_1, const Field &z_2, const evaluations &evaluations, const srs &srs, const Field &gamma_1, const Field &gamma_2, const evaluation_witness &witness, const std::vector< commitment > &cm_1s, const std::vector< commitment > &cm_2s, const Field &r) |
Batched version of KZG10, as described in Section 3 of [GWC19]. Supports evaluation of arbitrary number of polynomials at 2 points, requiring a fixed-size witness (of 2 elements of G1), which can be verified with 2 pairings (similarly to KZG10) and a number of group operations proportional to the number of polynomials.
Note, this could be extended to the case of N evaluation points (and thereby N sets of polynomials).
Definition at line 31 of file kzg10_batched.hpp.
using libsnark::kzg10_batched_2_point< ppT >::commitment = typename kzg10<ppT>::commitment |
Definition at line 40 of file kzg10_batched.hpp.
using libsnark::kzg10_batched_2_point< ppT >::Field = libff::Fr<ppT> |
Definition at line 34 of file kzg10_batched.hpp.
using libsnark::kzg10_batched_2_point< ppT >::srs = typename kzg10<ppT>::srs |
The srs generated by the setup step. This is denoted PK in [KZG10] section 3.2.
Definition at line 38 of file kzg10_batched.hpp.
|
static |
Generate a witness to prove the correctness of these evaluations. Returns a multi_point_evaluation_witness
object holding this data.
|
static |
Evaluate the polynomials and return an evaluation object. f_s are evaluated at z_1 and g_s are evaluated at z_2.
|
static |
Given an evaluation
and evaluation_witness
generated for polynomials with commitments cm_1s
and cm_2s
, verify the witnesses using randomness r. This convinces the verifier that the given polynomials attain the claimed values at the evaluation points z_1 and z_2.