pub struct Logs<V: Variant, P: PublicKey, M: Faults> { /* private fields */ }Expand description
Accumulates dealer logs for a DKG round and caches verification results so
pre_verify work can be reused until a dealer’s log is replaced.
Implementations§
Source§impl<V: Variant, P: PublicKey, M: Faults> Logs<V, P, M>
impl<V: Variant, P: PublicKey, M: Faults> Logs<V, P, M>
Sourcepub fn record(&mut self, dealer: P, log: DealerLog<V, P>) -> bool
pub fn record(&mut self, dealer: P, log: DealerLog<V, P>) -> bool
Record the log for a particular dealer.
Return true if the dealer was already present in the log, in which
case its log will be replaced.
Sourcepub fn pre_verify<B: BatchVerifier<PublicKey = P>>(
&mut self,
rng: &mut impl CryptoRngCore,
strategy: &impl Strategy,
)
pub fn pre_verify<B: BatchVerifier<PublicKey = P>>( &mut self, rng: &mut impl CryptoRngCore, strategy: &impl Strategy, )
Verify the logs that we’ve received so far.
This makes finalization faster, by doing some of the verification work now.
This method can amortize work over a batch of items. It’s more efficient
to call it after several Self::record, rather than after
each call.
Trait Implementations§
Auto Trait Implementations§
impl<V, P, M> Freeze for Logs<V, P, M>
impl<V, P, M> RefUnwindSafe for Logs<V, P, M>where
M: RefUnwindSafe,
P: RefUnwindSafe,
<V as Variant>::Public: RefUnwindSafe + UnwindSafe,
<P as Verifier>::Signature: RefUnwindSafe,
impl<V, P, M> Send for Logs<V, P, M>where
M: Send,
impl<V, P, M> Sync for Logs<V, P, M>where
M: Sync,
impl<V, P, M> Unpin for Logs<V, P, M>
impl<V, P, M> UnsafeUnpin for Logs<V, P, M>
impl<V, P, M> UnwindSafe for Logs<V, P, M>where
P: RefUnwindSafe + UnwindSafe,
M: UnwindSafe,
<V as Variant>::Public: RefUnwindSafe + UnwindSafe,
<P as Verifier>::Signature: RefUnwindSafe,
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> 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