pub struct Clerk<D: Clone + Digest> { /* private fields */ }Expand description
Clerk can verify and aggregate SingleSignatures and verify AggregateSignatures.
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 + Send + Sync> Clerk<D>
impl<D: Digest + Clone + FixedOutput + Send + Sync> Clerk<D>
Sourcepub fn new_clerk_from_closed_key_registration(
params: &Parameters,
closed_reg: &ClosedKeyRegistration<D>,
) -> Self
pub fn new_clerk_from_closed_key_registration( params: &Parameters, closed_reg: &ClosedKeyRegistration<D>, ) -> Self
Create a new Clerk from a closed registration instance.
Sourcepub fn from_registration(
params: &Parameters,
closed_reg: &ClosedKeyRegistration<D>,
) -> Self
👎Deprecated since 0.5.0: Use new_clerk_from_closed_key_registration instead
pub fn from_registration( params: &Parameters, closed_reg: &ClosedKeyRegistration<D>, ) -> Self
new_clerk_from_closed_key_registration insteadCreate a new Clerk from a closed registration instance.
Sourcepub fn new_clerk_from_signer(signer: &Signer<D>) -> Self
pub fn new_clerk_from_signer(signer: &Signer<D>) -> Self
Create a Clerk from a signer.
Sourcepub fn from_signer(signer: &Signer<D>) -> Self
👎Deprecated since 0.5.0: Use new_clerk_from_signer instead
pub fn from_signer(signer: &Signer<D>) -> Self
new_clerk_from_signer insteadCreate a Clerk from a signer.
Sourcepub fn aggregate_signatures(
&self,
sigs: &[SingleSignature],
msg: &[u8],
) -> Result<AggregateSignature<D>, AggregationError>
👎Deprecated since 0.5.3: Use aggregate_signatures_with_type instead
pub fn aggregate_signatures( &self, sigs: &[SingleSignature], msg: &[u8], ) -> Result<AggregateSignature<D>, AggregationError>
aggregate_signatures_with_type insteadAggregate a set of signatures.
Sourcepub fn aggregate_signatures_with_type(
&self,
sigs: &[SingleSignature],
msg: &[u8],
aggregate_signature_type: AggregateSignatureType,
) -> Result<AggregateSignature<D>, AggregationError>
pub fn aggregate_signatures_with_type( &self, sigs: &[SingleSignature], msg: &[u8], aggregate_signature_type: AggregateSignatureType, ) -> Result<AggregateSignature<D>, AggregationError>
Aggregate a set of signatures with a given proof type.
Sourcepub fn aggregate(
&self,
sigs: &[SingleSignature],
msg: &[u8],
) -> Result<AggregateSignature<D>, AggregationError>
👎Deprecated since 0.5.0: Use aggregate_signatures instead
pub fn aggregate( &self, sigs: &[SingleSignature], msg: &[u8], ) -> Result<AggregateSignature<D>, AggregationError>
aggregate_signatures insteadAggregate 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_aggregate_verification_key(&self) -> AggregateVerificationKey<D>
pub fn compute_aggregate_verification_key(&self) -> AggregateVerificationKey<D>
Compute the AggregateVerificationKey related to the used registration.
Sourcepub fn compute_avk(&self) -> AggregateVerificationKey<D>
👎Deprecated since 0.5.0: Use compute_aggregate_verification_key instead
pub fn compute_avk(&self) -> AggregateVerificationKey<D>
compute_aggregate_verification_key insteadCompute the AggregateVerificationKey related to the used registration.
Sourcepub fn get_registered_party_for_index(
&self,
party_index: &Index,
) -> Option<(VerificationKey, Stake)>
pub fn get_registered_party_for_index( &self, party_index: &Index, ) -> Option<(VerificationKey, Stake)>
Get the (VK, stake) of a party given its index.
Sourcepub fn get_reg_party(
&self,
party_index: &Index,
) -> Option<(VerificationKey, Stake)>
👎Deprecated since 0.5.0: Use get_registered_party_for_index instead
pub fn get_reg_party( &self, party_index: &Index, ) -> Option<(VerificationKey, Stake)>
get_registered_party_for_index insteadGet the (VK, stake) of a party given its index.