Public input verification utility for the test framework

This commit is contained in:
Sean Bowe 2018-03-15 11:42:22 -06:00
parent 2c69abe268
commit 827e85547e
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
1 changed files with 14 additions and 0 deletions

View File

@ -294,6 +294,20 @@ impl<E: Engine> TestConstraintSystem<E> {
} }
} }
pub fn verify(&self, expected: &[E::Fr]) -> bool
{
assert_eq!(expected.len() + 1, self.inputs.len());
for (a, b) in self.inputs.iter().skip(1).zip(expected.iter())
{
if &a.0 != b {
return false
}
}
return true;
}
pub fn num_inputs(&self) -> usize { pub fn num_inputs(&self) -> usize {
self.inputs.len() self.inputs.len()
} }