Added r1cs ppzksnark proving scheme and some tests.

This commit is contained in:
Sean Bowe
2015-12-25 05:52:14 -07:00
parent a66c21fe11
commit fc1bdf2148
5 changed files with 317 additions and 31 deletions

View File

@@ -1,7 +1,16 @@
extern crate tinysnark;
extern crate rand;
use tinysnark::{Proof, Keypair, FieldT, LinearTerm, ConstraintSystem};
fn main() {
tinysnark::init();
tinysnark::test();
let mut cs = ConstraintSystem::new(1, 2);
cs.add_constraint(
&[LinearTerm{coeff: FieldT::one(), index: 2}],
&[LinearTerm{coeff: FieldT::one(), index: 3}],
&[LinearTerm{coeff: FieldT::one(), index: 1}]
);
assert!(cs.test(&[100.into()], &[10.into(), 10.into()]));
}