From 2d1f69328f7d07347eb2043a06a4e254f1d8dc1f Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Fri, 25 Sep 2020 09:39:32 -0600 Subject: [PATCH] Rename `OpeningProof` to just `Proof`. --- src/plonk.rs | 5 ++--- src/plonk/prover.rs | 4 ++-- src/poly/commitment.rs | 4 ++-- src/poly/commitment/prover.rs | 6 +++--- src/poly/commitment/verifier.rs | 10 +++++----- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/plonk.rs b/src/plonk.rs index 553df39a..968afb2b 100644 --- a/src/plonk.rs +++ b/src/plonk.rs @@ -7,8 +7,7 @@ use crate::arithmetic::CurveAffine; use crate::poly::{ - commitment::OpeningProof, Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff, - Polynomial, + commitment, Coeff, EvaluationDomain, ExtendedLagrangeCoeff, LagrangeCoeff, Polynomial, }; use crate::transcript::Hasher; @@ -55,7 +54,7 @@ pub struct Proof { h_evals: Vec, f_commitment: C, q_evals: Vec, - opening: OpeningProof, + opening: commitment::Proof, } /// This is an error that could occur during proving or circuit synthesis. diff --git a/src/plonk/prover.rs b/src/plonk/prover.rs index 8d347de1..4b6573eb 100644 --- a/src/plonk/prover.rs +++ b/src/plonk/prover.rs @@ -7,7 +7,7 @@ use crate::arithmetic::{ Curve, CurveAffine, Field, }; use crate::poly::{ - commitment::{Blind, OpeningProof, Params}, + commitment::{self, Blind, Params}, Coeff, LagrangeCoeff, Polynomial, Rotation, }; use crate::transcript::Hasher; @@ -633,7 +633,7 @@ impl Proof { } if let Ok(opening) = - OpeningProof::create(¶ms, &mut transcript, &f_poly, f_blind_dup, x_6) + commitment::Proof::create(¶ms, &mut transcript, &f_poly, f_blind_dup, x_6) { break (opening, q_evals); } else { diff --git a/src/poly/commitment.rs b/src/poly/commitment.rs index 8348b774..eaec55fc 100644 --- a/src/poly/commitment.rs +++ b/src/poly/commitment.rs @@ -15,7 +15,7 @@ mod verifier; /// This is a proof object for the polynomial commitment scheme opening. #[derive(Debug, Clone)] -pub struct OpeningProof { +pub struct Proof { rounds: Vec<(C, C)>, delta: C, z1: C::Scalar, @@ -434,7 +434,7 @@ fn test_opening_proof() { loop { let transcript_dup = transcript.clone(); - let opening_proof = OpeningProof::create(¶ms, &mut transcript, &px, blind, x); + let opening_proof = Proof::create(¶ms, &mut transcript, &px, blind, x); if opening_proof.is_err() { transcript = transcript_dup; transcript.absorb(Field::one()); diff --git a/src/poly/commitment/prover.rs b/src/poly/commitment/prover.rs index 0bf2a101..1147c1e0 100644 --- a/src/poly/commitment/prover.rs +++ b/src/poly/commitment/prover.rs @@ -1,12 +1,12 @@ use super::super::{Coeff, Error, Polynomial}; -use super::{Blind, OpeningProof, Params}; +use super::{Blind, Params, Proof}; use crate::arithmetic::{ best_multiexp, compute_inner_product, get_challenge_scalar, parallelize, small_multiexp, Challenge, Curve, CurveAffine, Field, }; use crate::transcript::Hasher; -impl OpeningProof { +impl Proof { /// Create a polynomial commitment opening proof for the polynomial defined /// by the coefficients `px`, the blinding factor `blind` used for the /// polynomial commitment, and the point `x` that the polynomial is @@ -186,7 +186,7 @@ impl OpeningProof { let z1 = a * &c + &d; let z2 = c * &blind + &s; - Ok(OpeningProof { + Ok(Proof { rounds, delta, z1, diff --git a/src/poly/commitment/verifier.rs b/src/poly/commitment/verifier.rs index 937bd463..01549344 100644 --- a/src/poly/commitment/verifier.rs +++ b/src/poly/commitment/verifier.rs @@ -1,13 +1,13 @@ use super::super::Error; -use super::{Guard, OpeningProof, Params, MSM}; +use super::{Guard, Params, Proof, MSM}; use crate::transcript::Hasher; use crate::arithmetic::{get_challenge_scalar, Challenge, CurveAffine, Field}; -impl OpeningProof { - /// Checks to see if an [`OpeningProof`] is valid given the current - /// `transcript`, and a point `x` that the polynomial commitment `p` opens - /// purportedly to the value `v`. +impl Proof { + /// Checks to see if an [`Proof`] is valid given the current `transcript`, + /// and a point `x` that the polynomial commitment `p` opens purportedly to + /// the value `v`. pub fn verify<'a, H: Hasher>( &self, params: &'a Params,