Clearmatics Libsnark  0.1
C++ library for zkSNARK proofs
Classes | Public Types | Static Public Member Functions | List of all members
libsnark::kzg10_batched_2_point< ppT > Class Template Reference

#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)
 

Detailed Description

template<typename ppT>
class libsnark::kzg10_batched_2_point< ppT >

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.

Member Typedef Documentation

◆ commitment

template<typename ppT >
using libsnark::kzg10_batched_2_point< ppT >::commitment = typename kzg10<ppT>::commitment

Definition at line 40 of file kzg10_batched.hpp.

◆ Field

template<typename ppT >
using libsnark::kzg10_batched_2_point< ppT >::Field = libff::Fr<ppT>

Definition at line 34 of file kzg10_batched.hpp.

◆ srs

template<typename ppT >
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.

Member Function Documentation

◆ create_evaluation_witness()

template<typename ppT >
static evaluation_witness libsnark::kzg10_batched_2_point< ppT >::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

Generate a witness to prove the correctness of these evaluations. Returns a multi_point_evaluation_witness object holding this data.

◆ evaluate_polynomials()

template<typename ppT >
static evaluations libsnark::kzg10_batched_2_point< ppT >::evaluate_polynomials ( const std::vector< polynomial< Field >> &  fs,
const std::vector< polynomial< Field >> &  gs,
const Field z_1,
const Field z_2 
)
static

Evaluate the polynomials and return an evaluation object. f_s are evaluated at z_1 and g_s are evaluated at z_2.

◆ verify_evaluations()

template<typename ppT >
static bool libsnark::kzg10_batched_2_point< ppT >::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 
)
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.


The documentation for this class was generated from the following file: