Skip to content

Commit 0a42455

Browse files
committed
chore: the prover will run if the witness vector is longer than needed.
This behavior is consistent with LinearRelation and CanonicalLinearRelation.
1 parent af79d52 commit 0a42455

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/schnorr_protocol.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ impl<G: PrimeGroup> SigmaProtocol for CanonicalLinearRelation<G> {
3636
/// - The prover state (random nonces and witness) used to compute the response.
3737
///
3838
/// # Errors
39-
/// -[`Error::InvalidInstanceWitnessPair`] if the witness vector length is incorrect.
39+
///
40+
/// -[`Error::InvalidInstanceWitnessPair`] if the witness vector length is less than the number of scalar variables.
41+
/// If the witness vector is larger, extra variables are ignored.
4042
fn prover_commit(
4143
&self,
4244
witness: &Self::Witness,
4345
rng: &mut (impl RngCore + CryptoRng),
4446
) -> Result<(Self::Commitment, Self::ProverState), Error> {
45-
if witness.len() != self.num_scalars {
47+
if witness.len() < self.num_scalars {
4648
return Err(Error::InvalidInstanceWitnessPair);
4749
}
4850

0 commit comments

Comments
 (0)