chore: misc comments (#329)

This commit is contained in:
dan
2023-09-13 05:52:04 +00:00
committed by GitHub
parent be9da5bc40
commit b321da420b
4 changed files with 9 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ use crate::{
MpcTlsChannel, MpcTlsError, MpcTlsFollowerConfig,
};
/// Wrapper for protocol instances of the follower
/// The follower of the MPC TLS protocol.
pub struct MpcTlsFollower {
config: MpcTlsFollowerConfig,
channel: MpcTlsChannel,

View File

@@ -1,4 +1,4 @@
//! This crate provides tooling for instantiating our MPC machinery for leader and follower.
//! This crate provides tooling for instantiating MPC TLS machinery for leader and follower.
//! The main API objects are [MpcTlsLeader] and [MpcTlsFollower], which wrap the necessary
//! cryptographic machinery and also an [MpcTlsChannel] for communication.

View File

@@ -49,10 +49,10 @@ use crate::error::OTShutdownError;
#[cfg(feature = "tracing")]
use tracing::{debug, debug_span, instrument, Instrument};
/// Bincode for serialization, multiplexing with Yamux.
/// A muxer which uses Bincode for serialization, Yamux for multiplexing.
type Mux = BincodeMux<UidYamuxControl>;
/// Prover future which must be polled for the connection to make progress.
/// Prover future which must be polled for the TLS connection to make progress.
pub struct ProverFuture {
#[allow(clippy::type_complexity)]
fut: Pin<Box<dyn Future<Output = Result<Prover<Closed>, ProverError>> + Send + 'static>>,
@@ -386,6 +386,7 @@ impl Prover<Notarize> {
}
}
/// Performs a setup of the various MPC subprotocols.
#[cfg_attr(feature = "tracing", instrument(level = "debug", skip_all, err))]
#[allow(clippy::type_complexity)]
async fn setup_mpc_backend(
@@ -504,6 +505,7 @@ async fn setup_mpc_backend(
Ok((mpc_tls, vm, ot_recv, gf2, ot_fut))
}
/// A future which must be polled for the muxer to make progress.
struct MuxFuture {
fut: Pin<Box<dyn FusedFuture<Output = Result<(), ProverError>> + Send + 'static>>,
}
@@ -525,6 +527,7 @@ impl FusedFuture for MuxFuture {
}
}
/// A future which must be polled for the Oblivious Transfer protocol to make progress.
struct OTFuture {
fut: Pin<Box<dyn FusedFuture<Output = Result<(), ProverError>> + Send + 'static>>,
}

View File

@@ -16,6 +16,7 @@ opaque_debug::implement!(Initialized);
/// State after MPC setup has completed.
pub struct Setup {
/// A muxer for communication with the Notary
pub(crate) notary_mux: Mux,
pub(crate) mux_fut: MuxFuture,
@@ -48,6 +49,7 @@ opaque_debug::implement!(Closed);
/// The state for the [Prover](crate::Prover) during notarization
pub struct Notarize {
/// A muxer for communication with the Notary
pub(crate) notary_mux: Mux,
pub(crate) mux_fut: MuxFuture,