Added r1cs ppzksnark proving scheme and some tests.
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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()]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user