pub struct Clerk<D: Clone + Digest> { /* private fields */ }
Expand description
Clerk
can verify and aggregate SingleSignature
s and verify AggregateSignature
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> Clerk<D>
impl<D: Digest + Clone + FixedOutput> Clerk<D>
Sourcepub fn from_registration(
params: &Parameters,
closed_reg: &ClosedKeyRegistration<D>,
) -> Self
pub fn from_registration( params: &Parameters, closed_reg: &ClosedKeyRegistration<D>, ) -> Self
Create a new Clerk
from a closed registration instance.
Sourcepub fn from_signer(signer: &Signer<D>) -> Self
pub fn from_signer(signer: &Signer<D>) -> Self
Create a Clerk from a signer.
Sourcepub fn aggregate(
&self,
sigs: &[SingleSignature],
msg: &[u8],
) -> Result<AggregateSignature<D>, AggregationError>
pub fn aggregate( &self, sigs: &[SingleSignature], msg: &[u8], ) -> Result<AggregateSignature<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 AggregateSignature
.
Sourcepub fn compute_avk(&self) -> AggregateVerificationKey<D>
pub fn compute_avk(&self) -> AggregateVerificationKey<D>
Compute the StmAggrVerificationKey
related to the used registration.
Sourcepub fn get_reg_party(
&self,
party_index: &Index,
) -> Option<(VerificationKey, Stake)>
pub fn get_reg_party( &self, party_index: &Index, ) -> Option<(VerificationKey, Stake)>
Get the (VK, stake) of a party given its index.