@@ -71,13 +71,13 @@ impl<S: SpartanExtensionField> SumcheckInstanceProof<S> {
7171}
7272
7373#[ derive( Serialize , Deserialize , Debug ) ]
74- pub struct ZKSumcheckInstanceProof < S : SpartanExtensionField > {
74+ pub struct R1CSSumcheckInstanceProof < S : SpartanExtensionField > {
7575 proofs : Vec < DotProductProof < S > > ,
7676}
7777
78- impl < S : SpartanExtensionField > ZKSumcheckInstanceProof < S > {
78+ impl < S : SpartanExtensionField > R1CSSumcheckInstanceProof < S > {
7979 pub fn new ( proofs : Vec < DotProductProof < S > > ) -> Self {
80- ZKSumcheckInstanceProof { proofs }
80+ R1CSSumcheckInstanceProof { proofs }
8181 }
8282
8383 pub fn verify (
@@ -381,10 +381,9 @@ impl<S: SpartanExtensionField> SumcheckInstanceProof<S> {
381381 }
382382}
383383
384- impl < S : SpartanExtensionField > ZKSumcheckInstanceProof < S > {
384+ impl < S : SpartanExtensionField > R1CSSumcheckInstanceProof < S > {
385385 pub fn prove_cubic_disjoint_rounds < F > (
386386 claim : & S ,
387- blind_claim : & S ,
388387 num_rounds : usize ,
389388 num_rounds_y_max : usize ,
390389 num_rounds_w : usize ,
@@ -398,7 +397,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
398397 comb_func : F ,
399398 transcript : & mut Transcript ,
400399 random_tape : & mut RandomTape < S > ,
401- ) -> ( Self , Vec < S > , Vec < S > , S )
400+ ) -> ( Self , Vec < S > , Vec < S > )
402401 where
403402 F : Fn ( & S , & S , & S ) -> S ,
404403 {
@@ -408,11 +407,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
408407 // poly_A is the EQ polynomial of size P * W * Y_max
409408 assert_eq ! ( num_rounds, num_rounds_y_max + num_rounds_w + num_rounds_p) ;
410409
411- let ( blinds_poly, blinds_evals) = (
412- random_tape. random_vector ( b"blinds_poly" , num_rounds) ,
413- random_tape. random_vector ( b"blinds_evals" , num_rounds) ,
414- ) ;
415-
416410 let mut claim_per_round = * claim;
417411
418412 let mut r: Vec < S > = Vec :: new ( ) ;
@@ -577,18 +571,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
577571 // compute a weighted sum of the RHS
578572 let target = w[ 0 ] * claim_per_round + w[ 1 ] * eval;
579573
580- let blind = {
581- let blind_sc = if j == 0 {
582- blind_claim
583- } else {
584- & blinds_evals[ j - 1 ]
585- } ;
586-
587- let blind_eval = & blinds_evals[ j] ;
588-
589- w[ 0 ] * * blind_sc + w[ 1 ] * * blind_eval
590- } ;
591-
592574 let a = {
593575 // the vector to use to decommit for sum-check test
594576 let a_sc = {
@@ -613,15 +595,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
613595 . collect :: < Vec < S > > ( )
614596 } ;
615597
616- let proof = DotProductProof :: prove (
617- transcript,
618- random_tape,
619- & poly. as_vec ( ) ,
620- & blinds_poly[ j] ,
621- & a,
622- & target,
623- & blind,
624- ) ;
598+ let proof = DotProductProof :: prove ( transcript, random_tape, & poly. as_vec ( ) , & a, & target) ;
625599
626600 ( proof, eval)
627601 } ;
@@ -632,20 +606,18 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
632606 }
633607
634608 (
635- ZKSumcheckInstanceProof :: new ( proofs) ,
609+ R1CSSumcheckInstanceProof :: new ( proofs) ,
636610 r,
637611 vec ! [
638612 poly_A[ 0 ] ,
639613 poly_B. index( 0 , 0 , 0 , 0 ) ,
640614 poly_C. index( 0 , 0 , 0 , 0 ) ,
641615 ] ,
642- blinds_evals[ num_rounds - 1 ] ,
643616 )
644617 }
645618
646619 pub fn prove_cubic_with_additive_term_disjoint_rounds < F > (
647620 claim : & S ,
648- blind_claim : & S ,
649621 num_rounds : usize ,
650622 num_rounds_x_max : usize ,
651623 num_rounds_q_max : usize ,
@@ -661,7 +633,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
661633 comb_func : F ,
662634 transcript : & mut Transcript ,
663635 random_tape : & mut RandomTape < S > ,
664- ) -> ( Self , Vec < S > , Vec < S > , S )
636+ ) -> ( Self , Vec < S > , Vec < S > )
665637 where
666638 F : Fn ( & S , & S , & S , & S ) -> S ,
667639 {
@@ -678,11 +650,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
678650 assert_eq ! ( poly_C. num_witness_secs, 1 ) ;
679651 assert_eq ! ( poly_D. num_witness_secs, 1 ) ;
680652
681- let ( blinds_poly, blinds_evals) = (
682- random_tape. random_vector ( b"blinds_poly" , num_rounds) ,
683- random_tape. random_vector ( b"blinds_evals" , num_rounds) ,
684- ) ;
685-
686653 let mut claim_per_round = * claim;
687654
688655 let mut r: Vec < S > = Vec :: new ( ) ;
@@ -864,18 +831,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
864831 // compute a weighted sum of the RHS
865832 let target = w[ 0 ] * claim_per_round + w[ 1 ] * eval;
866833
867- let blind = {
868- let blind_sc = if j == 0 {
869- blind_claim
870- } else {
871- & blinds_evals[ j - 1 ]
872- } ;
873-
874- let blind_eval = & blinds_evals[ j] ;
875-
876- w[ 0 ] * * blind_sc + w[ 1 ] * * blind_eval
877- } ;
878-
879834 let a = {
880835 // the vector to use to decommit for sum-check test
881836 let a_sc = {
@@ -900,15 +855,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
900855 . collect :: < Vec < S > > ( )
901856 } ;
902857
903- let proof = DotProductProof :: prove (
904- transcript,
905- random_tape,
906- & poly. as_vec ( ) ,
907- & blinds_poly[ j] ,
908- & a,
909- & target,
910- & blind,
911- ) ;
858+ let proof = DotProductProof :: prove ( transcript, random_tape, & poly. as_vec ( ) , & a, & target) ;
912859
913860 ( proof, eval)
914861 } ;
@@ -919,15 +866,14 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
919866 }
920867
921868 (
922- ZKSumcheckInstanceProof :: new ( proofs) ,
869+ R1CSSumcheckInstanceProof :: new ( proofs) ,
923870 r,
924871 vec ! [
925872 poly_Ap[ 0 ] * poly_Aq[ 0 ] * poly_Ax[ 0 ] ,
926873 poly_B. index( 0 , 0 , 0 , 0 ) ,
927874 poly_C. index( 0 , 0 , 0 , 0 ) ,
928875 poly_D. index( 0 , 0 , 0 , 0 ) ,
929876 ] ,
930- blinds_evals[ num_rounds - 1 ] ,
931877 )
932878 }
933879}
0 commit comments