Skip to content

Commit

Permalink
refactor: key exchange interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sinui0 committed Jan 25, 2025
1 parent 95d05e4 commit ce323b6
Show file tree
Hide file tree
Showing 6 changed files with 275 additions and 341 deletions.
2 changes: 1 addition & 1 deletion crates/components/key-exchange/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ tokio = { workspace = true, features = ["sync"] }
mpz-ot = { workspace = true, features = ["ideal"] }
mpz-garble = { workspace = true }

rand_chacha = { workspace = true }
rand_core = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread"] }
rstest = { workspace = true }
7 changes: 1 addition & 6 deletions crates/components/key-exchange/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::error::Error;
/// MPC-TLS protocol error.
#[derive(Debug, thiserror::Error)]
#[error(transparent)]
pub struct KeyExchangeError(#[from] ErrorRepr);
pub struct KeyExchangeError(#[from] pub(crate) ErrorRepr);

#[derive(Debug, thiserror::Error)]
#[error("key exchange error: {0}")]
Expand Down Expand Up @@ -66,11 +66,6 @@ impl KeyExchangeError {
{
Self(ErrorRepr::Key(err.into()))
}

#[cfg(test)]
pub(crate) fn kind(&self) -> &ErrorRepr {
&self.0
}
}

impl From<mpz_common::ContextError> for KeyExchangeError {
Expand Down
Loading

0 comments on commit ce323b6

Please sign in to comment.