pasta_curves-source/src/poly/multiopen.rs

48 lines
1.3 KiB
Rust
Raw Normal View History

2020-09-29 07:23:41 +00:00
//! This module contains an implementation of the multipoint opening polynomial
//! commitment scheme described in the [Halo][halo] paper.
//!
//! [halo]: https://eprint.iacr.org/2019/1021
use super::*;
use crate::arithmetic::CurveAffine;
mod prover;
mod verifier;
/// This is a multi-point opening proof used in the polynomial commitment scheme opening.
#[derive(Debug, Clone)]
pub struct Proof<C: CurveAffine> {
// A vector of evaluations at each set of query points
q_evals: Vec<C::Scalar>,
2020-09-29 07:23:41 +00:00
// Commitment to final polynomial
f_commitment: C,
2020-09-29 07:23:41 +00:00
// Commitment proof
opening: commitment::Proof<C>,
2020-09-29 07:23:41 +00:00
}
/// 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,
}