diff --git a/components/tls/tls-mpc/src/follower.rs b/components/tls/tls-mpc/src/follower.rs index 7a1378399..b7437bb3b 100644 --- a/components/tls/tls-mpc/src/follower.rs +++ b/components/tls/tls-mpc/src/follower.rs @@ -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, diff --git a/components/tls/tls-mpc/src/lib.rs b/components/tls/tls-mpc/src/lib.rs index 3c5631c2b..5b612d4b7 100644 --- a/components/tls/tls-mpc/src/lib.rs +++ b/components/tls/tls-mpc/src/lib.rs @@ -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. diff --git a/tlsn/tlsn-prover/src/lib.rs b/tlsn/tlsn-prover/src/lib.rs index 8957e1956..209c3d1cd 100644 --- a/tlsn/tlsn-prover/src/lib.rs +++ b/tlsn/tlsn-prover/src/lib.rs @@ -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; -/// 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, ProverError>> + Send + 'static>>, @@ -386,6 +386,7 @@ impl Prover { } } +/// 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> + 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> + Send + 'static>>, } diff --git a/tlsn/tlsn-prover/src/state.rs b/tlsn/tlsn-prover/src/state.rs index 11fdaa434..fb29432a1 100644 --- a/tlsn/tlsn-prover/src/state.rs +++ b/tlsn/tlsn-prover/src/state.rs @@ -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,