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.