Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
drewstone committed Feb 12, 2024
1 parent 316b524 commit 0369386
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 221 deletions.
76 changes: 34 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 16 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ round-based = { git = "https://github.com/webb-tools/round-based-protocol", feat
curv = { package = "curv-kzen", version = "0.10.0" }
dfns-cggmp21 = { package = "cggmp21", version = "0.1.1", default-features = false }
udigest = { version = "0.1", features = ["std", "derive"]}
frost-core = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-ed25519 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-ed448 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-p256 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-p384 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-ristretto255 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-secp256k1 = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-rerandomized = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-core = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-ed25519 = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-ed448 = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-p256 = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-p384 = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-ristretto255 = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-secp256k1 = { git = "https://github.com/LIT-Protocol/frost.git" }
# frost-rerandomized = { git = "https://github.com/LIT-Protocol/frost.git" }
frost-core = { path = "../frost/frost-core" }
frost-ed25519 = { path = "../frost/frost-ed25519" }
frost-ed448 = { path = "../frost/frost-ed448" }
frost-p256 = { path = "../frost/frost-p256" }
frost-p384 = { path = "../frost/frost-p384" }
frost-ristretto255 = { path = "../frost/frost-ristretto255" }
frost-secp256k1 = { path = "../frost/frost-secp256k1" }
frost-rerandomized = { path = "../frost/frost-rerandomized" }
bls12_381_plus = "0.8.13"

sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
Expand Down
2 changes: 1 addition & 1 deletion protocols/zcash-frost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rand_chacha = { version = "0.3", default-features = false }
dfns-cggmp21 = { workspace = true }

udigest = { workspace = true }
frost-core = { workspace = true }
frost-core = { workspace = true, features = ["cheater-detection"] }
frost-ed25519 = { workspace = true }
frost-ed448 = { workspace = true }
frost-p256 = { workspace = true }
Expand Down
43 changes: 0 additions & 43 deletions protocols/zcash-frost/src/rounds/errors.rs

This file was deleted.

9 changes: 5 additions & 4 deletions protocols/zcash-frost/src/rounds/keygen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use round_based::{
use serde::{Deserialize, Serialize};
use tangle_primitives::roles::ThresholdSignatureRoleType;

use super::{errors::IoError, KeygenAborted, KeygenError, Reason};
use super::{IoError, KeygenAborted, KeygenError, Reason};

/// Message of key generation protocol
#[derive(ProtocolMessage, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -90,6 +90,7 @@ where
tracer.round_begins();

tracer.stage("Compute round 1 dkg secret package");
println!("Keygen | i: {}, t: {}, n: {}", i, t, n);
let (round1_secret_package, round1_package) =
dkg_part1(i + 1, t, n, role, rng).map_err(|e| {
KeygenError(Reason::KeygenFailure(KeygenAborted::FrostError {
Expand All @@ -116,15 +117,15 @@ where
.complete(round1)
.await
.map_err(|e| KeygenError(Reason::IoError(IoError::receive_message(e))))?
.into_vec_including_me(my_round1_msg)
.into_vec_including_me(my_round1_msg.clone())
.into_iter()
.map(|msg| {
round1::Package::deserialize(&msg.msg)
.unwrap_or_else(|_| panic!("Failed to deserialize round 1 package"))
})
.collect();
tracer.msgs_received();

println!("Keygen | i: {}, my_package: {:#?}", i, round1_package);
tracer.stage("Compute round 2 dkg secret package");
let round1_packages_map: BTreeMap<Identifier<C>, round1::Package<C>> = round1_packages
.iter()
Expand All @@ -137,7 +138,7 @@ where
})
.filter(|(inx, _)| *inx != Identifier::try_from(i + 1).unwrap())
.collect();

println!("Keygen | round1_packages_map: {:#?}", round1_packages_map);
let (round2_secret_package, round2_packages_map) =
dkg_part2(role, round1_secret_package, &round1_packages_map).map_err(|e| {
KeygenError(Reason::KeygenFailure(KeygenAborted::FrostError {
Expand Down
Loading

0 comments on commit 0369386

Please sign in to comment.