Struct mithril_stm::stm::StmClerk
source · pub struct StmClerk<D: Clone + Digest> { /* private fields */ }
Expand description
StmClerk
can verify and aggregate StmSig
s and verify StmMultiSig
s.
Clerks can only be generated with the registration closed.
This avoids that a Merkle Tree is computed before all parties have registered.
Implementations§
source§impl<D: Digest + Clone + FixedOutput> StmClerk<D>
impl<D: Digest + Clone + FixedOutput> StmClerk<D>
sourcepub fn from_registration(
params: &StmParameters,
closed_reg: &ClosedKeyReg<D>,
) -> Self
pub fn from_registration( params: &StmParameters, closed_reg: &ClosedKeyReg<D>, ) -> Self
Create a new Clerk
from a closed registration instance.
sourcepub fn from_signer(signer: &StmSigner<D>) -> Self
pub fn from_signer(signer: &StmSigner<D>) -> Self
Create a Clerk from a signer.
sourcepub fn aggregate(
&self,
sigs: &[StmSig],
msg: &[u8],
) -> Result<StmAggrSig<D>, AggregationError>
pub fn aggregate( &self, sigs: &[StmSig], msg: &[u8], ) -> Result<StmAggrSig<D>, AggregationError>
Aggregate a set of signatures for their corresponding indices.
This function first deduplicates the repeated signatures, and if there are enough signatures, it collects the merkle tree indexes of unique signatures. The list of merkle tree indexes is used to create a batch proof, to prove that all signatures are from eligible signers.
It returns an instance of StmAggrSig
.
sourcepub fn compute_avk(&self) -> StmAggrVerificationKey<D>
pub fn compute_avk(&self) -> StmAggrVerificationKey<D>
Compute the StmAggrVerificationKey
related to the used registration.
sourcepub fn get_reg_party(
&self,
party_index: &Index,
) -> Option<(StmVerificationKey, Stake)>
pub fn get_reg_party( &self, party_index: &Index, ) -> Option<(StmVerificationKey, Stake)>
Get the (VK, stake) of a party given its index.
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for StmClerk<D>
impl<D> RefUnwindSafe for StmClerk<D>where
D: RefUnwindSafe,
impl<D> Send for StmClerk<D>
impl<D> Sync for StmClerk<D>
impl<D> Unpin for StmClerk<D>
impl<D> UnwindSafe for StmClerk<D>where
D: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)