mirror of https://github.com/zcash/halo2.git
Introduce Query and CommitmentData structs for multiopen
This commit is contained in:
parent
1e21c08acd
commit
cbe4415870
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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>>(
|
||||
|
|
|
@ -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>>(
|
||||
|
|
Loading…
Reference in New Issue