Introduce Query and CommitmentData structs for multiopen

This commit is contained in:
therealyingtong 2020-10-07 21:57:54 +08:00
parent 1e21c08acd
commit cbe4415870
3 changed files with 39 additions and 0 deletions

View File

@ -21,3 +21,27 @@ pub struct Proof<C: CurveAffine> {
/// Commitment proof
pub opening: commitment::Proof<C>,
}
/// A polynomial query at a point
#[derive(Debug, Clone)]
pub struct ProverQuery<'a, C: CurveAffine> {
/// point at which polynomial is queried
pub point: C::Scalar,
/// coefficients of polynomial
pub poly: &'a Polynomial<C::Scalar, Coeff>,
/// blinding factor of polynomial
pub blind: commitment::Blind<C::Scalar>,
/// evaluation of polynomial at query point
pub eval: C::Scalar,
}
/// A polynomial query at a point
#[derive(Debug, Clone)]
pub struct VerifierQuery<'a, C: CurveAffine> {
/// point at which polynomial is queried
pub point: C::Scalar,
/// commitment to polynomial
pub commitment: &'a C,
/// evaluation of polynomial at query point
pub eval: C::Scalar,
}

View File

@ -13,6 +13,14 @@ use crate::arithmetic::{
use crate::plonk::hash_point;
use crate::transcript::Hasher;
#[derive(Debug, Clone)]
struct CommitmentData<C: CurveAffine> {
set_index: usize,
blind: Blind<C::Scalar>,
point_indices: Vec<usize>,
evals: Vec<C::Scalar>,
}
impl<C: CurveAffine> Proof<C> {
/// Create a multi-opening proof
pub fn create<I, HBase: Hasher<C::Base>, HScalar: Hasher<C::Scalar>>(

View File

@ -4,6 +4,13 @@ use crate::arithmetic::{get_challenge_scalar, Challenge, CurveAffine, Field};
use crate::plonk::hash_point;
use crate::transcript::Hasher;
#[derive(Debug, Clone)]
struct CommitmentData<C: CurveAffine> {
set_index: usize,
point_indices: Vec<usize>,
evals: Vec<C::Scalar>,
}
impl<'a, C: CurveAffine> Proof<C> {
/// Verify a multi-opening proof
pub fn verify<I, HBase: Hasher<C::Base>, HScalar: Hasher<C::Scalar>>(