pub struct QuicTwoPartyNet { /* private fields */ }Expand description
Implements an MpcNetwork on top of QUIC
Implementations§
Source§impl<'a> QuicTwoPartyNet
impl<'a> QuicTwoPartyNet
pub fn new( party_id: PartyId, local_addr: SocketAddr, peer_addr: SocketAddr, ) -> Self
Sourcepub async fn connect(&mut self) -> Result<(), MpcNetworkError>
pub async fn connect(&mut self) -> Result<(), MpcNetworkError>
Establishes connections to the peer
Trait Implementations§
Source§impl Debug for QuicTwoPartyNet
impl Debug for QuicTwoPartyNet
Source§impl MpcNetwork for QuicTwoPartyNet
impl MpcNetwork for QuicTwoPartyNet
Source§fn send_bytes<'life0, 'life1, 'async_trait>(
&'life0 mut self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_bytes<'life0, 'life1, 'async_trait>(
&'life0 mut self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The local party sends a byte buffer to the peer with an additional u64
prepended specifying the length of the payload
Source§fn receive_bytes<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_bytes<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The local party awaits bytes from a peer; receiver expects that the payload
is prepended with a length indicating the message size
Source§fn send_scalars<'life0, 'life1, 'async_trait>(
&'life0 mut self,
scalars: &'life1 [Scalar],
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_scalars<'life0, 'life1, 'async_trait>(
&'life0 mut self,
scalars: &'life1 [Scalar],
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The local party sends a vector of scalars to the peer
Source§fn receive_scalars<'life0, 'async_trait>(
&'life0 mut self,
num_scalars: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Scalar>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_scalars<'life0, 'async_trait>(
&'life0 mut self,
num_scalars: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Scalar>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The local party receives exactly
n scalars from the peerSource§fn broadcast_scalars<'life0, 'life1, 'async_trait>(
&'life0 mut self,
scalars: &'life1 [Scalar],
) -> Pin<Box<dyn Future<Output = Result<Vec<Scalar>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast_scalars<'life0, 'life1, 'async_trait>(
&'life0 mut self,
scalars: &'life1 [Scalar],
) -> Pin<Box<dyn Future<Output = Result<Vec<Scalar>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Both parties broadcast a vector of scalars to one another
Source§fn send_points<'life0, 'life1, 'async_trait>(
&'life0 mut self,
points: &'life1 [RistrettoPoint],
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_points<'life0, 'life1, 'async_trait>(
&'life0 mut self,
points: &'life1 [RistrettoPoint],
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The local party sends a vector of Ristretto points to the peer
Source§fn receive_points<'life0, 'async_trait>(
&'life0 mut self,
num_points: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RistrettoPoint>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_points<'life0, 'async_trait>(
&'life0 mut self,
num_points: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<RistrettoPoint>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The local party awaits a vector of Ristretto points from the peer
Source§fn broadcast_points<'life0, 'life1, 'async_trait>(
&'life0 mut self,
points: &'life1 [RistrettoPoint],
) -> Pin<Box<dyn Future<Output = Result<Vec<RistrettoPoint>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast_points<'life0, 'life1, 'async_trait>(
&'life0 mut self,
points: &'life1 [RistrettoPoint],
) -> Pin<Box<dyn Future<Output = Result<Vec<RistrettoPoint>, MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Both parties broadcast a vector of points to one another
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Closes the connections opened in the handshake phase
Source§fn send_single_scalar<'life0, 'async_trait>(
&'life0 mut self,
scalar: Scalar,
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn send_single_scalar<'life0, 'async_trait>(
&'life0 mut self,
scalar: Scalar,
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
The local party sends a single scalar to the peer
Source§fn receive_single_scalar<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Scalar, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn receive_single_scalar<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Scalar, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
The local party receives a single scalar from the peer
Source§fn broadcast_single_scalar<'life0, 'async_trait>(
&'life0 mut self,
scalar: Scalar,
) -> Pin<Box<dyn Future<Output = Result<Scalar, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn broadcast_single_scalar<'life0, 'async_trait>(
&'life0 mut self,
scalar: Scalar,
) -> Pin<Box<dyn Future<Output = Result<Scalar, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Both parties broadcast a single scalar to one another
Source§fn send_single_point<'life0, 'async_trait>(
&'life0 mut self,
point: RistrettoPoint,
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn send_single_point<'life0, 'async_trait>(
&'life0 mut self,
point: RistrettoPoint,
) -> Pin<Box<dyn Future<Output = Result<(), MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
The local party sends a single Ristretto point to the peer
Source§fn receive_single_point<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<RistrettoPoint, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn receive_single_point<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<RistrettoPoint, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
The local party awaits a single Ristretto point from the peer
Source§fn broadcast_single_point<'life0, 'async_trait>(
&'life0 mut self,
point: RistrettoPoint,
) -> Pin<Box<dyn Future<Output = Result<RistrettoPoint, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn broadcast_single_point<'life0, 'async_trait>(
&'life0 mut self,
point: RistrettoPoint,
) -> Pin<Box<dyn Future<Output = Result<RistrettoPoint, MpcNetworkError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Both parties broadcast a single point to one another
Auto Trait Implementations§
impl Freeze for QuicTwoPartyNet
impl !RefUnwindSafe for QuicTwoPartyNet
impl Send for QuicTwoPartyNet
impl Sync for QuicTwoPartyNet
impl Unpin for QuicTwoPartyNet
impl UnsafeUnpin for QuicTwoPartyNet
impl !UnwindSafe for QuicTwoPartyNet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more