mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
Introduce Query and CommitmentData structs for multiopen
This commit is contained in:
parent
1e21c08acd
commit
cbe4415870
3 changed files with 39 additions and 0 deletions
|
|
@ -21,3 +21,27 @@ pub struct Proof<C: CurveAffine> {
|
||||||
/// Commitment proof
|
/// Commitment proof
|
||||||
pub opening: commitment::Proof<C>,
|
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::plonk::hash_point;
|
||||||
use crate::transcript::Hasher;
|
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> {
|
impl<C: CurveAffine> Proof<C> {
|
||||||
/// Create a multi-opening proof
|
/// Create a multi-opening proof
|
||||||
pub fn create<I, HBase: Hasher<C::Base>, HScalar: Hasher<C::Scalar>>(
|
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::plonk::hash_point;
|
||||||
use crate::transcript::Hasher;
|
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> {
|
impl<'a, C: CurveAffine> Proof<C> {
|
||||||
/// Verify a multi-opening proof
|
/// Verify a multi-opening proof
|
||||||
pub fn verify<I, HBase: Hasher<C::Base>, HScalar: Hasher<C::Scalar>>(
|
pub fn verify<I, HBase: Hasher<C::Base>, HScalar: Hasher<C::Scalar>>(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue