-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: start to add cpu code for iris matching * feat: add more cpu code * more cpu code * . * . * added eyre error handling * added static assertions * removed hawk pack dependency --------- Co-authored-by: Roman Walch <[email protected]> Co-authored-by: Dragos Rotaru <[email protected]>
- Loading branch information
1 parent
19b1c80
commit 3793432
Showing
21 changed files
with
3,987 additions
and
159 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
[workspace] | ||
members = [ | ||
"iris-mpc", | ||
"iris-mpc-cpu", | ||
"iris-mpc-gpu", | ||
"iris-mpc-common", | ||
"iris-mpc-upgrade", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "iris-mpc-cpu" | ||
version = "0.1.0" | ||
edition = "2021" | ||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
|
||
[dependencies] | ||
aes-prng = "0.2" | ||
bytes = "1.7" | ||
bytemuck.workspace = true | ||
eyre.workspace = true | ||
futures.workspace = true | ||
iris-mpc-common = { path = "../iris-mpc-common" } | ||
num-traits = "0.2" | ||
rand.workspace = true | ||
rayon.workspace = true | ||
serde.workspace = true | ||
static_assertions.workspace = true | ||
thiserror = "1.0" | ||
tokio.workspace = true | ||
tracing.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pub(crate) mod networks; | ||
pub mod prelude; | ||
pub(crate) mod protocol; | ||
pub(crate) mod shares; | ||
pub(crate) mod utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub(crate) mod network_trait; | ||
pub(crate) mod test_network; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use bytes::{Bytes, BytesMut}; | ||
use eyre::{Error, Result}; | ||
use iris_mpc_common::id::PartyID; | ||
pub type IoError = std::io::Error; | ||
|
||
#[allow(async_fn_in_trait)] | ||
pub trait NetworkTrait: Send + Sync { | ||
fn get_id(&self) -> PartyID; | ||
|
||
async fn shutdown(self) -> Result<(), IoError>; | ||
|
||
async fn send(&mut self, id: PartyID, data: Bytes) -> Result<(), IoError>; | ||
async fn send_next_id(&mut self, data: Bytes) -> Result<(), IoError>; | ||
async fn send_prev_id(&mut self, data: Bytes) -> Result<(), IoError>; | ||
|
||
async fn receive(&mut self, id: PartyID) -> Result<BytesMut, IoError>; | ||
async fn receive_prev_id(&mut self) -> Result<BytesMut, IoError>; | ||
async fn receive_next_id(&mut self) -> Result<BytesMut, IoError>; | ||
|
||
async fn broadcast(&mut self, data: Bytes) -> Result<Vec<BytesMut>, IoError>; | ||
//======= sync world ========= | ||
fn blocking_send(&mut self, id: PartyID, data: Bytes) -> Result<(), IoError>; | ||
fn blocking_send_next_id(&mut self, data: Bytes) -> Result<(), IoError>; | ||
fn blocking_send_prev_id(&mut self, data: Bytes) -> Result<(), IoError>; | ||
|
||
fn blocking_receive(&mut self, id: PartyID) -> Result<BytesMut, IoError>; | ||
fn blocking_receive_prev_id(&mut self) -> Result<BytesMut, IoError>; | ||
fn blocking_receive_next_id(&mut self) -> Result<BytesMut, IoError>; | ||
|
||
fn blocking_broadcast(&mut self, data: Bytes) -> Result<Vec<BytesMut>, IoError>; | ||
} | ||
|
||
#[allow(async_fn_in_trait)] | ||
pub trait NetworkEstablisher<N: NetworkTrait> { | ||
fn get_id(&self) -> PartyID; | ||
fn get_num_parties(&self) -> usize; | ||
async fn open_channel(&mut self) -> Result<N, Error>; | ||
async fn shutdown(self) -> Result<(), Error>; | ||
//======= sync world ========= | ||
fn print_connection_stats(&self, out: &mut impl std::io::Write) -> std::io::Result<()>; | ||
fn get_send_receive(&self, i: usize) -> std::io::Result<(u64, u64)>; | ||
} |
Oops, something went wrong.