mirror of https://github.com/zcash/mpc.git
Update bn and add logging.
This commit is contained in:
parent
983af331b2
commit
97e2f2036d
|
@ -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)",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -16,4 +16,4 @@ gcc = "0.3.*"
|
|||
[dependencies]
|
||||
libc = "0.2.*"
|
||||
lazy_static = "0.1.*"
|
||||
bn = "0.2.3"
|
||||
bn = "0.3.0"
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue