From 92a293c0c28d356b15e09b8086b2a9bf05963f04 Mon Sep 17 00:00:00 2001 From: "github-merge-queue[bot]" Date: Wed, 13 Mar 2024 19:26:04 +0000 Subject: [PATCH] deploy: 2fa1f98cd729967c3e69d3cb75ff3b15015810bf --- docs/arecibo/spartan/ppsnark/index.html | 2 +- docs/arecibo/spartan/ppsnark/struct.RelaxedR1CSSNARK.html | 4 ++-- .../arecibo/traits/snark/trait.RelaxedR1CSSNARKTrait.html | 2 +- docs/src/arecibo/r1cs/sparse.rs.html | 8 ++++---- docs/src/arecibo/spartan/batched.rs.html | 4 ++-- docs/src/arecibo/spartan/polys/power.rs.html | 2 +- docs/src/arecibo/spartan/ppsnark.rs.html | 4 +++- docs/src/arecibo/spartan/snark.rs.html | 8 ++++---- 8 files changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/arecibo/spartan/ppsnark/index.html b/docs/arecibo/spartan/ppsnark/index.html index 91e2a266e..71f98ac6d 100644 --- a/docs/arecibo/spartan/ppsnark/index.html +++ b/docs/arecibo/spartan/ppsnark/index.html @@ -1,5 +1,5 @@ arecibo::spartan::ppsnark - Rust -

Module arecibo::spartan::ppsnark

source ·
Expand description

This module implements RelaxedR1CSSNARK traits using a spark-based approach to prove evaluations of +

Module arecibo::spartan::ppsnark

source ·
Expand description

This module implements RelaxedR1CSSNARK traits using a spark-based approach to prove evaluations of sparse multilinear polynomials involved in Spartan’s sum-check protocol, thereby providing a preprocessing SNARK The verifier in this preprocessing SNARK maintains a commitment to R1CS matrices. This is beneficial when using a polynomial commitment scheme in which the verifier’s costs is succinct. diff --git a/docs/arecibo/spartan/ppsnark/struct.RelaxedR1CSSNARK.html b/docs/arecibo/spartan/ppsnark/struct.RelaxedR1CSSNARK.html index c64b2080d..b308bae43 100644 --- a/docs/arecibo/spartan/ppsnark/struct.RelaxedR1CSSNARK.html +++ b/docs/arecibo/spartan/ppsnark/struct.RelaxedR1CSSNARK.html @@ -7,14 +7,14 @@ EE::EvaluationArgument: Clone,

source§

fn clone(&self) -> RelaxedR1CSSNARK<E, EE>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Debug + Engine, EE: Debug + EvaluationEngineTrait<E>> Debug for RelaxedR1CSSNARK<E, EE>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, E: Engine, EE: EvaluationEngineTrait<E>> Deserialize<'de> for RelaxedR1CSSNARK<E, EE>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for RelaxedR1CSSNARK<E, EE>

source§

fn prove( + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for RelaxedR1CSSNARK<E, EE>

source§

fn prove( ck: &<<E as Engine>::CE as CommitmentEngineTrait<E>>::CommitmentKey, pk: &Self::ProverKey, S: &R1CSShape<E>, U: &RelaxedR1CSInstance<E>, W: &RelaxedR1CSWitness<E> ) -> Result<Self, NovaError>

produces a succinct proof of satisfiability of a RelaxedR1CS instance

-
source§

fn verify( +

source§

fn verify( &self, vk: &Self::VerifierKey, U: &RelaxedR1CSInstance<E> diff --git a/docs/arecibo/traits/snark/trait.RelaxedR1CSSNARKTrait.html b/docs/arecibo/traits/snark/trait.RelaxedR1CSSNARKTrait.html index 128fbba8f..95444c226 100644 --- a/docs/arecibo/traits/snark/trait.RelaxedR1CSSNARKTrait.html +++ b/docs/arecibo/traits/snark/trait.RelaxedR1CSSNARKTrait.html @@ -46,4 +46,4 @@ a minimum sizing cue for the commitment key used by this SNARK implementation. The commitment key passed in setup should then be at least as large as this hint.

-

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::batched::BatchedRelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::batched_ppsnark::BatchedRelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::ppsnark::RelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::snark::RelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

\ No newline at end of file +

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::batched::BatchedRelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::batched_ppsnark::BatchedRelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::ppsnark::RelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

source§

impl<E: Engine, EE: EvaluationEngineTrait<E>> RelaxedR1CSSNARKTrait<E> for arecibo::spartan::snark::RelaxedR1CSSNARK<E, EE>

§

type ProverKey = ProverKey<E, EE>

§

type VerifierKey = VerifierKey<E, EE>

\ No newline at end of file diff --git a/docs/src/arecibo/r1cs/sparse.rs.html b/docs/src/arecibo/r1cs/sparse.rs.html index d5579deee..9ee685079 100644 --- a/docs/src/arecibo/r1cs/sparse.rs.html +++ b/docs/src/arecibo/r1cs/sparse.rs.html @@ -545,13 +545,13 @@ level = "trace", name = "SparseMatrix::multiply_vec_unchecked" )] - pub fn multiply_vec_unchecked(&self, vector: &[F]) -> Vec<F> { + fn multiply_vec_unchecked(&self, vector: &[F]) -> Vec<F> { let mut sink: Vec<F> = Vec::with_capacity(self.indptr.len() - 1); self.multiply_vec_into_unchecked(vector, &mut sink); sink } - pub fn multiply_vec_into_unchecked(&self, vector: &[F], sink: &mut Vec<F>) { + fn multiply_vec_into_unchecked(&self, vector: &[F], sink: &mut Vec<F>) { self .indptr .par_windows(2) @@ -578,7 +578,7 @@ level = "trace", name = "SparseMatrix::multiply_vec_unchecked" )] - pub fn multiply_witness_unchecked(&self, W: &[F], u: &F, X: &[F]) -> Vec<F> { + fn multiply_witness_unchecked(&self, W: &[F], u: &F, X: &[F]) -> Vec<F> { // preallocate the result vector let mut sink = Vec::with_capacity(self.indptr.len() - 1); self.multiply_witness_into_unchecked(W, u, X, &mut sink); @@ -594,7 +594,7 @@ /// Multiply by a witness representing a dense vector; uses rayon to parallelize. /// This does not check that the shape of the matrix/vector are compatible. - pub fn multiply_witness_into_unchecked(&self, W: &[F], u: &F, X: &[F], sink: &mut Vec<F>) { + fn multiply_witness_into_unchecked(&self, W: &[F], u: &F, X: &[F], sink: &mut Vec<F>) { let num_vars = W.len(); self .indptr diff --git a/docs/src/arecibo/spartan/batched.rs.html b/docs/src/arecibo/spartan/batched.rs.html index 349c93281..7221ea0ed 100644 --- a/docs/src/arecibo/spartan/batched.rs.html +++ b/docs/src/arecibo/spartan/batched.rs.html @@ -646,7 +646,7 @@ math::Math, polys::{eq::EqPolynomial, multilinear::MultilinearPolynomial}, powers, - snark::batch_eval_prove, + snark::batch_eval_reduce, sumcheck::SumcheckProof, PolyEvalInstance, PolyEvalWitness, }; @@ -977,7 +977,7 @@ }; let (batched_u, batched_w, sc_proof_batch, claims_batch_left) = - batch_eval_prove(u_vec, &w_vec, &mut transcript)?; + batch_eval_reduce(u_vec, &w_vec, &mut transcript)?; let eval_arg = EE::prove( ck, diff --git a/docs/src/arecibo/spartan/polys/power.rs.html b/docs/src/arecibo/spartan/polys/power.rs.html index b70fd948d..c3140d926 100644 --- a/docs/src/arecibo/spartan/polys/power.rs.html +++ b/docs/src/arecibo/spartan/polys/power.rs.html @@ -97,7 +97,7 @@ /// Create powers the following powers of `t`: /// [t^{2^0}, t^{2^1}, ..., t^{2^{ell-1}}] - pub(in crate::spartan) fn squares(t: &Scalar, ell: usize) -> Vec<Scalar> { + pub fn squares(t: &Scalar, ell: usize) -> Vec<Scalar> { successors(Some(*t), |p: &Scalar| Some(p.square())) .take(ell) .collect::<Vec<_>>() diff --git a/docs/src/arecibo/spartan/ppsnark.rs.html b/docs/src/arecibo/spartan/ppsnark.rs.html index 4153f0b41..fbff628fd 100644 --- a/docs/src/arecibo/spartan/ppsnark.rs.html +++ b/docs/src/arecibo/spartan/ppsnark.rs.html @@ -1073,6 +1073,7 @@ 1072 1073 1074 +1075
//! This module implements `RelaxedR1CSSNARK` traits using a spark-based approach to prove evaluations of
 //! sparse multilinear polynomials involved in Spartan's sum-check protocol, thereby providing a preprocessing SNARK
 //! The verifier in this preprocessing SNARK maintains a commitment to R1CS matrices. This is beneficial when using a
@@ -1659,10 +1660,11 @@
     let u: PolyEvalInstance<E> =
       PolyEvalInstance::batch(&comm_vec, tau_coords.clone(), &eval_vec, &c);
 
-    // we now need to prove three claims
+    // we now need to prove four claims
     // (1) 0 = \sum_x poly_tau(x) * (poly_Az(x) * poly_Bz(x) - poly_uCz_E(x)), and eval_Az_at_tau + r * eval_Bz_at_tau + r^2 * eval_Cz_at_tau = (Az+r*Bz+r^2*Cz)(tau)
     // (2) eval_Az_at_tau + c * eval_Bz_at_tau + c^2 * eval_Cz_at_tau = \sum_y L_row(y) * (val_A(y) + c * val_B(y) + c^2 * val_C(y)) * L_col(y)
     // (3) L_row(i) = eq(tau, row(i)) and L_col(i) = z(col(i))
+    // (4) Check that the witness polynomial W is well-formed e.g., it is padded with only zeros
     let gamma = transcript.squeeze(b"g")?;
     let r = transcript.squeeze(b"r")?;
 
diff --git a/docs/src/arecibo/spartan/snark.rs.html b/docs/src/arecibo/spartan/snark.rs.html
index adf89f85a..88266672c 100644
--- a/docs/src/arecibo/spartan/snark.rs.html
+++ b/docs/src/arecibo/spartan/snark.rs.html
@@ -805,7 +805,7 @@
     ];
 
     let (batched_u, batched_w, sc_proof_batch, claims_batch_left) =
-      batch_eval_prove(u_vec, &w_vec, &mut transcript)?;
+      batch_eval_reduce(u_vec, &w_vec, &mut transcript)?;
 
     let eval_arg = EE::prove(
       ck,
@@ -969,8 +969,8 @@
   }
 }
 
-/// Proves a batch of polynomial evaluation claims using Sumcheck
-/// reducing them to a single claim at the same point.
+/// Reduces a batch of polynomial evaluation claims using Sumcheck
+/// to a single claim at the same point.
 ///
 /// # Details
 ///
@@ -983,7 +983,7 @@
 ///
 /// We allow the polynomial Pᵢ to have different sizes, by appropriately scaling
 /// the claims and resulting evaluations from Sumcheck.
-pub(in crate::spartan) fn batch_eval_prove<E: Engine>(
+pub(in crate::spartan) fn batch_eval_reduce<E: Engine>(
   u_vec: Vec<PolyEvalInstance<E>>,
   w_vec: &[PolyEvalWitness<E>],
   transcript: &mut E::TE,