Skip to content

Commit af0d37b

Browse files
mmakerIan Goldberg
andcommitted
Stronger validation criterias for the prover.
Co-Authored-By: Ian Goldberg <[email protected]>
1 parent cf1bb17 commit af0d37b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/schnorr_protocol.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,15 @@ where
9999
return Err(Error::InvalidInstanceWitnessPair);
100100
}
101101

102-
// If the relation being proven is trivial, refuse to prove the statement.
103-
if self.0.image.iter().any(|&x| x == G::identity()) {
102+
// If the image is the identity, then the relation must be
103+
// trivial, or else the proof will be unsound
104+
if self
105+
.0
106+
.image
107+
.iter()
108+
.zip(self.0.linear_combinations.iter())
109+
.any(|(&x, c)| x == G::identity() && !c.is_empty())
110+
{
104111
return Err(Error::InvalidInstanceWitnessPair);
105112
}
106113

0 commit comments

Comments
 (0)