Skip to content

Commit

Permalink
Merge pull request #1 from dfns/new-repo
Browse files Browse the repository at this point in the history
Update repo after changing location
  • Loading branch information
survived authored Feb 15, 2024
2 parents 1b372fe + 3f7bab9 commit c4258eb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @survived
* @dfns/research
3 changes: 2 additions & 1 deletion LICENSE-APACHE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/random-generation-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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]));
}
}
2 changes: 1 addition & 1 deletion round-based-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions round-based/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
9 changes: 9 additions & 0 deletions round-based/src/rounds_router/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ pub struct RoundsRouterBuilder<M> {
rounds: HashMap<u16, Option<Box<dyn ProcessRoundMessage<Msg = M> + Send>>>,
}

impl<M> Default for RoundsRouterBuilder<M>
where
M: ProtocolMessage + 'static,
{
fn default() -> Self {
Self::new()
}
}

impl<M> RoundsRouterBuilder<M>
where
M: ProtocolMessage + 'static,
Expand Down
11 changes: 4 additions & 7 deletions round-based/src/rounds_router/simple_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()),
}),
}
}

Expand Down Expand Up @@ -210,7 +207,7 @@ impl<M> RoundMsgs<M> {
pub fn into_iter_indexed(self) -> impl Iterator<Item = (PartyIndex, MsgId, M)> {
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))
}
Expand Down

0 comments on commit c4258eb

Please sign in to comment.