@@ -71,13 +71,13 @@ impl<S: SpartanExtensionField> SumcheckInstanceProof<S> {
71
71
}
72
72
73
73
#[ derive( Serialize , Deserialize , Debug ) ]
74
- pub struct ZKSumcheckInstanceProof < S : SpartanExtensionField > {
74
+ pub struct R1CSSumcheckInstanceProof < S : SpartanExtensionField > {
75
75
proofs : Vec < DotProductProof < S > > ,
76
76
}
77
77
78
- impl < S : SpartanExtensionField > ZKSumcheckInstanceProof < S > {
78
+ impl < S : SpartanExtensionField > R1CSSumcheckInstanceProof < S > {
79
79
pub fn new ( proofs : Vec < DotProductProof < S > > ) -> Self {
80
- ZKSumcheckInstanceProof { proofs }
80
+ R1CSSumcheckInstanceProof { proofs }
81
81
}
82
82
83
83
pub fn verify (
@@ -381,10 +381,9 @@ impl<S: SpartanExtensionField> SumcheckInstanceProof<S> {
381
381
}
382
382
}
383
383
384
- impl < S : SpartanExtensionField > ZKSumcheckInstanceProof < S > {
384
+ impl < S : SpartanExtensionField > R1CSSumcheckInstanceProof < S > {
385
385
pub fn prove_cubic_disjoint_rounds < F > (
386
386
claim : & S ,
387
- blind_claim : & S ,
388
387
num_rounds : usize ,
389
388
num_rounds_y_max : usize ,
390
389
num_rounds_w : usize ,
@@ -398,7 +397,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
398
397
comb_func : F ,
399
398
transcript : & mut Transcript ,
400
399
random_tape : & mut RandomTape < S > ,
401
- ) -> ( Self , Vec < S > , Vec < S > , S )
400
+ ) -> ( Self , Vec < S > , Vec < S > )
402
401
where
403
402
F : Fn ( & S , & S , & S ) -> S ,
404
403
{
@@ -408,11 +407,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
408
407
// poly_A is the EQ polynomial of size P * W * Y_max
409
408
assert_eq ! ( num_rounds, num_rounds_y_max + num_rounds_w + num_rounds_p) ;
410
409
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
-
416
410
let mut claim_per_round = * claim;
417
411
418
412
let mut r: Vec < S > = Vec :: new ( ) ;
@@ -577,18 +571,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
577
571
// compute a weighted sum of the RHS
578
572
let target = w[ 0 ] * claim_per_round + w[ 1 ] * eval;
579
573
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
-
592
574
let a = {
593
575
// the vector to use to decommit for sum-check test
594
576
let a_sc = {
@@ -613,15 +595,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
613
595
. collect :: < Vec < S > > ( )
614
596
} ;
615
597
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) ;
625
599
626
600
( proof, eval)
627
601
} ;
@@ -632,20 +606,18 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
632
606
}
633
607
634
608
(
635
- ZKSumcheckInstanceProof :: new ( proofs) ,
609
+ R1CSSumcheckInstanceProof :: new ( proofs) ,
636
610
r,
637
611
vec ! [
638
612
poly_A[ 0 ] ,
639
613
poly_B. index( 0 , 0 , 0 , 0 ) ,
640
614
poly_C. index( 0 , 0 , 0 , 0 ) ,
641
615
] ,
642
- blinds_evals[ num_rounds - 1 ] ,
643
616
)
644
617
}
645
618
646
619
pub fn prove_cubic_with_additive_term_disjoint_rounds < F > (
647
620
claim : & S ,
648
- blind_claim : & S ,
649
621
num_rounds : usize ,
650
622
num_rounds_x_max : usize ,
651
623
num_rounds_q_max : usize ,
@@ -661,7 +633,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
661
633
comb_func : F ,
662
634
transcript : & mut Transcript ,
663
635
random_tape : & mut RandomTape < S > ,
664
- ) -> ( Self , Vec < S > , Vec < S > , S )
636
+ ) -> ( Self , Vec < S > , Vec < S > )
665
637
where
666
638
F : Fn ( & S , & S , & S , & S ) -> S ,
667
639
{
@@ -678,11 +650,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
678
650
assert_eq ! ( poly_C. num_witness_secs, 1 ) ;
679
651
assert_eq ! ( poly_D. num_witness_secs, 1 ) ;
680
652
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
-
686
653
let mut claim_per_round = * claim;
687
654
688
655
let mut r: Vec < S > = Vec :: new ( ) ;
@@ -864,18 +831,6 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
864
831
// compute a weighted sum of the RHS
865
832
let target = w[ 0 ] * claim_per_round + w[ 1 ] * eval;
866
833
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
-
879
834
let a = {
880
835
// the vector to use to decommit for sum-check test
881
836
let a_sc = {
@@ -900,15 +855,7 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
900
855
. collect :: < Vec < S > > ( )
901
856
} ;
902
857
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) ;
912
859
913
860
( proof, eval)
914
861
} ;
@@ -919,15 +866,14 @@ impl<S: SpartanExtensionField> ZKSumcheckInstanceProof<S> {
919
866
}
920
867
921
868
(
922
- ZKSumcheckInstanceProof :: new ( proofs) ,
869
+ R1CSSumcheckInstanceProof :: new ( proofs) ,
923
870
r,
924
871
vec ! [
925
872
poly_Ap[ 0 ] * poly_Aq[ 0 ] * poly_Ax[ 0 ] ,
926
873
poly_B. index( 0 , 0 , 0 , 0 ) ,
927
874
poly_C. index( 0 , 0 , 0 , 0 ) ,
928
875
poly_D. index( 0 , 0 , 0 , 0 ) ,
929
876
] ,
930
- blinds_evals[ num_rounds - 1 ] ,
931
877
)
932
878
}
933
879
}
0 commit comments