File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -681,12 +681,6 @@ impl<G: PrimeGroup> TryFrom<&LinearRelation<G>> for CanonicalLinearRelation<G> {
681681 ) ) ;
682682 }
683683
684- // if relation.linear_map.linear_combinations.is_empty() {
685- // return Err(InvalidInstance::new(
686- // "Empty relations cannot be proven"
687- // ));
688- // }
689-
690684 // If any linear combination is empty, the relation is invalid
691685 if relation
692686 . linear_map
Original file line number Diff line number Diff line change 55
66#[ cfg( test) ]
77mod instance_validation {
8- use crate :: { linear_relation:: { CanonicalLinearRelation , LinearRelation } , tests :: spec :: rng } ;
8+ use crate :: linear_relation:: { CanonicalLinearRelation , LinearRelation } ;
99 use bls12_381:: { G1Projective as G , Scalar } ;
1010
1111 #[ test]
@@ -131,6 +131,16 @@ mod instance_validation {
131131 assert ! ( result. is_err( ) ) ;
132132 }
133133
134+
135+ #[ test]
136+ fn test_empty_string ( ) {
137+ let rng = & mut rand:: thread_rng ( ) ;
138+ let relation = LinearRelation :: < G > :: new ( ) ;
139+ let nizk = relation. into_nizk ( b"test_session" ) . unwrap ( ) ;
140+ let narg_string = nizk. prove_batchable ( & vec ! [ ] , rng) . unwrap ( ) ;
141+ assert ! ( narg_string. is_empty( ) ) ;
142+ }
143+
134144 #[ test]
135145 fn without_witness ( ) {
136146 let B = G :: generator ( ) ;
You can’t perform that action at this time.
0 commit comments