diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fb4f292..57f3974 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @survived +* @dfns/research diff --git a/LICENSE-APACHE b/LICENSE-APACHE index 7b8a5b2..1359712 100644 --- a/LICENSE-APACHE +++ b/LICENSE-APACHE @@ -186,7 +186,8 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2023 + Copyright 2023 Zengo X + Copyright 2024 Dfns Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/LICENSE-MIT b/LICENSE-MIT index f889381..e9bb563 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,7 @@ MIT License Copyright (c) 2023 Zengo X +Copyright (c) 2024 Dfns Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/examples/random-generation-protocol/src/lib.rs b/examples/random-generation-protocol/src/lib.rs index 1fe5f51..6a777d1 100644 --- a/examples/random-generation-protocol/src/lib.rs +++ b/examples/random-generation-protocol/src/lib.rs @@ -52,7 +52,7 @@ where rng.fill_bytes(&mut local_randomness); // 2. Commit local randomness (broadcast m=sha256(randomness)) - let commitment = Sha256::digest(&local_randomness); + let commitment = Sha256::digest(local_randomness); outgoing .send(Outgoing::broadcast(Msg::CommitMsg(CommitMsg { commitment, @@ -86,7 +86,7 @@ where .into_iter_indexed() .zip(randomness.into_iter_indexed()) { - let commitment_expected = Sha256::digest(&decommit.randomness); + let commitment_expected = Sha256::digest(decommit.randomness); if commit.commitment != commitment_expected { guilty_parties.push(Blame { guilty_party: party_i, @@ -161,6 +161,6 @@ mod tests { assert_eq!(output[0], output[usize::from(i)]); } - println!("Output randomness: {}", hex::encode(&output[0])); + println!("Output randomness: {}", hex::encode(output[0])); } } diff --git a/round-based-derive/Cargo.toml b/round-based-derive/Cargo.toml index 0f7ca07..5c758fe 100644 --- a/round-based-derive/Cargo.toml +++ b/round-based-derive/Cargo.toml @@ -4,7 +4,7 @@ version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" description = "Proc-macro for deriving `round-based` traits" -repository = "https://github.com/ZenGo-X/round-based-protocol" +repository = "https://github.com/dfns/round-based" [lib] proc-macro = true diff --git a/round-based/Cargo.toml b/round-based/Cargo.toml index 71271cd..4558d52 100644 --- a/round-based/Cargo.toml +++ b/round-based/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "round-based" -version = "0.2.0" +version = "0.2.1" edition = "2021" license = "MIT OR Apache-2.0" description = "Driver for MPC protocols" -repository = "https://github.com/ZenGo-X/round-based-protocol" +repository = "https://github.com/dfns/round-based" categories = ["asynchronous", "cryptography", "network-programming"] keywords = ["round-based", "mpc", "protocol"] readme = "../README.md" diff --git a/round-based/src/rounds_router/mod.rs b/round-based/src/rounds_router/mod.rs index 8535fe4..7d03e1c 100644 --- a/round-based/src/rounds_router/mod.rs +++ b/round-based/src/rounds_router/mod.rs @@ -234,6 +234,15 @@ pub struct RoundsRouterBuilder { rounds: HashMap + Send>>>, } +impl Default for RoundsRouterBuilder +where + M: ProtocolMessage + 'static, +{ + fn default() -> Self { + Self::new() + } +} + impl RoundsRouterBuilder where M: ProtocolMessage + 'static, diff --git a/round-based/src/rounds_router/simple_store.rs b/round-based/src/rounds_router/simple_store.rs index 49d0b28..76898d0 100644 --- a/round-based/src/rounds_router/simple_store.rs +++ b/round-based/src/rounds_router/simple_store.rs @@ -117,8 +117,7 @@ where msg_id: msg.id, expected: self.expected_msg_type, actual: msg.msg_type, - } - .into()); + }); } if msg.sender == self.i { // Ignore own messages @@ -141,14 +140,12 @@ where Some(Some(_)) => Err(RoundInputError::AttemptToOverwriteReceivedMsg { msgs_ids: [self.messages_ids[index], msg.id], sender: msg.sender, - } - .into()), + }), None => Err(RoundInputError::SenderIndexOutOfRange { msg_id: msg.id, sender: msg.sender, n: self.n, - } - .into()), + }), } } @@ -210,7 +207,7 @@ impl RoundMsgs { pub fn into_iter_indexed(self) -> impl Iterator { let parties_indexes = (0..self.i).chain(self.i + 1..); parties_indexes - .zip(self.ids.into_iter()) + .zip(self.ids) .zip(self.messages) .map(|((party_ind, msg_id), msg)| (party_ind, msg_id, msg)) }