pub trait Reconstructible: Sized {
type Value: Serialize + DeserializeOwned + for<'de> SchemaRead<'de, Dst = Self::Value> + SchemaWrite<Src = Self::Value> + Clone + PartialEq + Send + Sync + 'static;
type Opening: Serialize + DeserializeOwned + for<'de> SchemaRead<'de, Dst = Self::Opening> + SchemaWrite<Src = Self::Opening> + Clone + Send + Sync + 'static;
// Required methods
fn open_to(
&self,
peer_index: PeerIndex,
) -> Result<Self::Opening, PrimitiveError>;
fn open_to_all_others(&self) -> impl ExactSizeIterator<Item = Self::Opening>;
fn reconstruct(
&self,
openings: Vec<Self::Opening>,
) -> Result<Self::Value, PrimitiveError>;
// Provided method
fn reconstruct_all<T: Borrow<Self>>(
shares: Vec<T>,
) -> Result<Self::Value, PrimitiveError> { ... }
}Expand description
Reconstructs a secret-shared value from a collection of openings and a local share.
Required Associated Types§
Sourcetype Value: Serialize + DeserializeOwned + for<'de> SchemaRead<'de, Dst = Self::Value> + SchemaWrite<Src = Self::Value> + Clone + PartialEq + Send + Sync + 'static
type Value: Serialize + DeserializeOwned + for<'de> SchemaRead<'de, Dst = Self::Value> + SchemaWrite<Src = Self::Value> + Clone + PartialEq + Send + Sync + 'static
The type of the reconstructed value.
Sourcetype Opening: Serialize + DeserializeOwned + for<'de> SchemaRead<'de, Dst = Self::Opening> + SchemaWrite<Src = Self::Opening> + Clone + Send + Sync + 'static
type Opening: Serialize + DeserializeOwned + for<'de> SchemaRead<'de, Dst = Self::Opening> + SchemaWrite<Src = Self::Opening> + Clone + Send + Sync + 'static
The type that is sent to / received from other peers.
Required Methods§
Sourcefn open_to(
&self,
peer_index: PeerIndex,
) -> Result<Self::Opening, PrimitiveError>
fn open_to( &self, peer_index: PeerIndex, ) -> Result<Self::Opening, PrimitiveError>
Open the share towards another peer.
Sourcefn open_to_all_others(&self) -> impl ExactSizeIterator<Item = Self::Opening>
fn open_to_all_others(&self) -> impl ExactSizeIterator<Item = Self::Opening>
Open the share towards all other peers. Returns an iterator with either one opening for each peer or a single opening for all peers.
Sourcefn reconstruct(
&self,
openings: Vec<Self::Opening>,
) -> Result<Self::Value, PrimitiveError>
fn reconstruct( &self, openings: Vec<Self::Opening>, ) -> Result<Self::Value, PrimitiveError>
Reconstruct a secret from openings coming from all other parties.
Provided Methods§
Sourcefn reconstruct_all<T: Borrow<Self>>(
shares: Vec<T>,
) -> Result<Self::Value, PrimitiveError>
fn reconstruct_all<T: Borrow<Self>>( shares: Vec<T>, ) -> Result<Self::Value, PrimitiveError>
Reconstruct a secret from a collection of shares, by opening each share
towards all other peers, reconstructing n secrets from the openings and
checking that they are all equal.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".