Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
fix examples with input DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Carmer committed Jun 4, 2019
1 parent 35fbfdb commit f37bdad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions examples/mixed_radix_addition_cost.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use fancy_garbling::informer::Informer;
use fancy_garbling::{error::InformerError, informer::{Informer, InformerVal}};
use fancy_garbling::*;
use itertools::Itertools;

fn main() {
let n = 5;
let ps = vec![3, 4, 7, 83];

let mut b = Informer::new();
let xs = (0..n).map(|_| b.garbler_input_bundle(&ps)).collect_vec();
let xs = (0..n).map(|_| b.receive_bundle(&ps)).collect::<Result<Vec<Bundle<InformerVal>>, InformerError>>().unwrap();
let z = b.mixed_radix_addition_msb_only(&xs).unwrap();
b.output(&z).unwrap();
b.print_info();
Expand Down
2 changes: 1 addition & 1 deletion examples/sign_cost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
let nprimes = 10;
let q = modulus_with_nprimes(nprimes);
let mut i = Informer::new();
let x = CrtBundle::from(i.garbler_input_bundle(&factor(q)));
let x = i.crt_receive(q).unwrap();
exact_sign(&mut i, &x);
i.print_info();
}

0 comments on commit f37bdad

Please sign in to comment.