pub struct Sharing<V: Variant> { /* private fields */ }Expand description
Represents the public output of a polynomial secret sharing.
This does not contain any secret information.
Implementations§
Source§impl<V: Variant> Sharing<V>
impl<V: Variant> Sharing<V>
Sourcepub fn required<M: Faults>(&self) -> u32
pub fn required<M: Faults>(&self) -> u32
Return the number of participants required to recover the secret using the given fault model.
Sourcepub const fn total(&self) -> NonZeroU32
pub const fn total(&self) -> NonZeroU32
Return the total number of participants in this sharing.
Sourcepub fn precompute_partial_publics(&self)
pub fn precompute_partial_publics(&self)
Call this to pre-compute the results of Self::partial_public.
This should be used if you expect to access many of the partial public keys, e.g. if verifying several public signatures.
The first time this method is called can be expensive, but subsequent calls are idempotent, and cheap.
Sourcepub fn partial_public(&self, i: Participant) -> Result<V::Public, Error>
pub fn partial_public(&self, i: Participant) -> Result<V::Public, Error>
Get the partial public key associated with a given participant.
This will return None if the index is greater >= Self::total.
Trait Implementations§
Source§impl<V: Variant> EncodeSize for Sharing<V>
impl<V: Variant> EncodeSize for Sharing<V>
Source§fn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Returns the encoded size of this value (in bytes).
Source§impl<V: Variant> Read for Sharing<V>
impl<V: Variant> Read for Sharing<V>
impl<V: Variant> Eq for Sharing<V>
Auto Trait Implementations§
impl<V> Freeze for Sharing<V>
impl<V> RefUnwindSafe for Sharing<V>
impl<V> Send for Sharing<V>
impl<V> Sync for Sharing<V>
impl<V> Unpin for Sharing<V>
impl<V> UnwindSafe for Sharing<V>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encode for Twhere
T: Write + EncodeSize,
impl<T> Encode for Twhere
T: Write + EncodeSize,
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