pub trait Reconstructible: Sized {
type Opening: Serialize + DeserializeOwned + Clone + Send + Sync + 'static;
type Secret: Serialize + DeserializeOwned + Clone + PartialEq + 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: &[Self::Opening],
) -> Result<Self::Secret, PrimitiveError>;
// Provided method
fn reconstruct_all<T: Borrow<Self>>(
shares: &[T],
) -> Result<Self::Secret, PrimitiveError> { ... }
}Expand description
Reconstructs a secret from a collection of openings and a local share.
Required Associated Types§
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: &[Self::Opening],
) -> Result<Self::Secret, PrimitiveError>
fn reconstruct( &self, openings: &[Self::Opening], ) -> Result<Self::Secret, PrimitiveError>
Reconstruct a secret from openings coming from all other parties.
Provided Methods§
Sourcefn reconstruct_all<T: Borrow<Self>>(
shares: &[T],
) -> Result<Self::Secret, PrimitiveError>
fn reconstruct_all<T: Borrow<Self>>( shares: &[T], ) -> Result<Self::Secret, 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", so this trait is not object safe.