2015-12-24 11:58:38 +02:00
|
|
|
extern crate tinysnark;
|
2015-12-25 14:52:14 +02:00
|
|
|
extern crate rand;
|
|
|
|
|
|
|
|
use tinysnark::{Proof, Keypair, FieldT, LinearTerm, ConstraintSystem};
|
2015-12-24 11:58:38 +02:00
|
|
|
|
|
|
|
fn main() {
|
2015-12-25 09:37:52 +02:00
|
|
|
tinysnark::init();
|
|
|
|
|
2015-12-25 14:52:14 +02:00
|
|
|
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()]));
|
2015-12-25 09:37:52 +02:00
|
|
|
}
|