phase2-bn254/src/main.rs

17 lines
456 B
Rust
Raw Normal View History

2015-12-24 11:58:38 +02:00
extern crate tinysnark;
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();
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
}