Rename `OpeningProof` to just `Proof`.

This commit is contained in:
Sean Bowe 2020-09-25 09:39:32 -06:00
parent 5f6c382546
commit 2d1f69328f
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
5 changed files with 14 additions and 15 deletions

View File

@ -7,8 +7,7 @@
use crate::arithmetic::CurveAffine; use crate::arithmetic::CurveAffine;
use crate::poly::{ use crate::poly::{
commitment::OpeningProof, Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff, commitment, Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial,
Polynomial,
}; };
use crate::transcript::Hasher; use crate::transcript::Hasher;
@ -55,7 +54,7 @@ pub struct Proof<C: CurveAffine> {
h_evals: Vec<C::Scalar>, h_evals: Vec<C::Scalar>,
f_commitment: C, f_commitment: C,
q_evals: Vec<C::Scalar>, q_evals: Vec<C::Scalar>,
opening: OpeningProof<C>, opening: commitment::Proof<C>,
} }
/// This is an error that could occur during proving or circuit synthesis. /// This is an error that could occur during proving or circuit synthesis.

View File

@ -7,7 +7,7 @@ use crate::arithmetic::{
Curve, CurveAffine, Field, Curve, CurveAffine, Field,
}; };
use crate::poly::{ use crate::poly::{
commitment::{Blind, OpeningProof, Params}, commitment::{self, Blind, Params},
Coeff, LagrangeCoeff, Polynomial, Rotation, Coeff, LagrangeCoeff, Polynomial, Rotation,
}; };
use crate::transcript::Hasher; use crate::transcript::Hasher;
@ -633,7 +633,7 @@ impl<C: CurveAffine> Proof<C> {
} }
if let Ok(opening) = if let Ok(opening) =
OpeningProof::create(&params, &mut transcript, &f_poly, f_blind_dup, x_6) commitment::Proof::create(&params, &mut transcript, &f_poly, f_blind_dup, x_6)
{ {
break (opening, q_evals); break (opening, q_evals);
} else { } else {

View File

@ -15,7 +15,7 @@ mod verifier;
/// This is a proof object for the polynomial commitment scheme opening. /// This is a proof object for the polynomial commitment scheme opening.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct OpeningProof<C: CurveAffine> { pub struct Proof<C: CurveAffine> {
rounds: Vec<(C, C)>, rounds: Vec<(C, C)>,
delta: C, delta: C,
z1: C::Scalar, z1: C::Scalar,
@ -434,7 +434,7 @@ fn test_opening_proof() {
loop { loop {
let transcript_dup = transcript.clone(); let transcript_dup = transcript.clone();
let opening_proof = OpeningProof::create(&params, &mut transcript, &px, blind, x); let opening_proof = Proof::create(&params, &mut transcript, &px, blind, x);
if opening_proof.is_err() { if opening_proof.is_err() {
transcript = transcript_dup; transcript = transcript_dup;
transcript.absorb(Field::one()); transcript.absorb(Field::one());

View File

@ -1,12 +1,12 @@
use super::super::{Coeff, Error, Polynomial}; use super::super::{Coeff, Error, Polynomial};
use super::{Blind, OpeningProof, Params}; use super::{Blind, Params, Proof};
use crate::arithmetic::{ use crate::arithmetic::{
best_multiexp, compute_inner_product, get_challenge_scalar, parallelize, small_multiexp, best_multiexp, compute_inner_product, get_challenge_scalar, parallelize, small_multiexp,
Challenge, Curve, CurveAffine, Field, Challenge, Curve, CurveAffine, Field,
}; };
use crate::transcript::Hasher; use crate::transcript::Hasher;
impl<C: CurveAffine> OpeningProof<C> { impl<C: CurveAffine> Proof<C> {
/// Create a polynomial commitment opening proof for the polynomial defined /// Create a polynomial commitment opening proof for the polynomial defined
/// by the coefficients `px`, the blinding factor `blind` used for the /// by the coefficients `px`, the blinding factor `blind` used for the
/// polynomial commitment, and the point `x` that the polynomial is /// polynomial commitment, and the point `x` that the polynomial is
@ -186,7 +186,7 @@ impl<C: CurveAffine> OpeningProof<C> {
let z1 = a * &c + &d; let z1 = a * &c + &d;
let z2 = c * &blind + &s; let z2 = c * &blind + &s;
Ok(OpeningProof { Ok(Proof {
rounds, rounds,
delta, delta,
z1, z1,

View File

@ -1,13 +1,13 @@
use super::super::Error; use super::super::Error;
use super::{Guard, OpeningProof, Params, MSM}; use super::{Guard, Params, Proof, MSM};
use crate::transcript::Hasher; use crate::transcript::Hasher;
use crate::arithmetic::{get_challenge_scalar, Challenge, CurveAffine, Field}; use crate::arithmetic::{get_challenge_scalar, Challenge, CurveAffine, Field};
impl<C: CurveAffine> OpeningProof<C> { impl<C: CurveAffine> Proof<C> {
/// Checks to see if an [`OpeningProof`] is valid given the current /// Checks to see if an [`Proof`] is valid given the current `transcript`,
/// `transcript`, and a point `x` that the polynomial commitment `p` opens /// and a point `x` that the polynomial commitment `p` opens purportedly to
/// purportedly to the value `v`. /// the value `v`.
pub fn verify<'a, H: Hasher<C::Base>>( pub fn verify<'a, H: Hasher<C::Base>>(
&self, &self,
params: &'a Params<C>, params: &'a Params<C>,