Update bn and add logging.

This commit is contained in:
Sean Bowe 2016-09-15 08:43:45 -06:00
parent 983af331b2
commit 97e2f2036d
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
5 changed files with 22 additions and 6 deletions

6
Cargo.lock generated
View File

@ -3,7 +3,7 @@ name = "mpc"
version = "0.0.1"
dependencies = [
"bincode 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bn 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bn 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -22,7 +22,7 @@ dependencies = [
[[package]]
name = "bn"
version = "0.2.3"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -77,7 +77,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "snark"
version = "0.0.1"
dependencies = [
"bn 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bn 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -11,7 +11,7 @@ readme = "README.md"
[dependencies]
snark = { path = "./snark/" }
bn = "0.2.3"
bn = "0.3.0"
crossbeam = "0.2.9"
rand = "0.3.14"
rustc-serialize = "~0.3.19"

View File

@ -16,4 +16,4 @@ gcc = "0.3.*"
[dependencies]
libc = "0.2.*"
lazy_static = "0.1.*"
bn = "0.2.3"
bn = "0.3.0"

View File

@ -42,7 +42,7 @@ fn main() {
println!("\tAll players have connected!");
println!("Constructing constraint system and performing QAP reduction...");
let cs = CS::dummy();
let cs = CS::from_file();
println!("\tDone.");
let rng = &mut ::rand::thread_rng();

View File

@ -35,11 +35,17 @@ fn main() {
// Round 2: Powers of tau
{
println!("Receiving current tau powers...");
let mut cur_g1: Vec<G1> = decode_from(stream, Infinite).unwrap();
let mut cur_g2: Vec<G2> = decode_from(stream, Infinite).unwrap();
println!("Calculating new tau powers...");
secrets.taupowers(&mut cur_g1, &mut cur_g2);
println!("Sending new tau powers...");
// Send spairs, new g1 / g2
encode_into(&spairs, stream, Infinite).unwrap();
encode_into(&cur_g1, stream, Infinite).unwrap();
@ -48,19 +54,29 @@ fn main() {
// Round 3: Random coeffs, part 1.
{
println!("Receiving current random coeffs (stage1)...");
let mut cur: Stage1Values = decode_from(stream, Infinite).unwrap();
println!("Calculating new random coeffs (stage1)...");
secrets.stage1(&mut cur);
println!("Sending new random coeffs (stage1)...");
encode_into(&cur, stream, Infinite).unwrap();
}
// Round 4: Random coeffs, part 2.
{
println!("Receiving current random coeffs (stage2)...");
let mut cur: Stage2Values = decode_from(stream, Infinite).unwrap();
println!("Calculating new random coeffs (stage2)...");
secrets.stage2(&mut cur);
println!("Sending new random coeffs (stage2)...");
encode_into(&cur, stream, Infinite).unwrap();
}