Trait tendermint_machine::ext::SignatureScheme
source · pub trait SignatureScheme: Send + Sync {
type ValidatorId: ValidatorId;
type Signature: Signature;
type AggregateSignature: Signature;
type Signer: Signer<ValidatorId = Self::ValidatorId, Signature = Self::Signature>;
fn verify(
&self,
validator: Self::ValidatorId,
msg: &[u8],
sig: &Self::Signature
) -> bool;
fn aggregate(sigs: &[Self::Signature]) -> Self::AggregateSignature;
fn verify_aggregate(
&self,
signers: &[Self::ValidatorId],
msg: &[u8],
sig: &Self::AggregateSignature
) -> bool;
}Expand description
A signature scheme used by validators.
Required Associated Types
type ValidatorId: ValidatorId
sourcetype AggregateSignature: Signature
type AggregateSignature: Signature
Type representing an aggregate signature. This would presumably be a BLS signature, yet even with Schnorr signatures half-aggregation is possible. It could even be a threshold signature scheme, though that’s currently unexpected.
sourcetype Signer: Signer<ValidatorId = Self::ValidatorId, Signature = Self::Signature>
type Signer: Signer<ValidatorId = Self::ValidatorId, Signature = Self::Signature>
Type representing a signer of this scheme.
Required Methods
sourcefn verify(
&self,
validator: Self::ValidatorId,
msg: &[u8],
sig: &Self::Signature
) -> bool
fn verify(
&self,
validator: Self::ValidatorId,
msg: &[u8],
sig: &Self::Signature
) -> bool
Verify a signature from the validator in question.
sourcefn aggregate(sigs: &[Self::Signature]) -> Self::AggregateSignature
fn aggregate(sigs: &[Self::Signature]) -> Self::AggregateSignature
Aggregate signatures.
sourcefn verify_aggregate(
&self,
signers: &[Self::ValidatorId],
msg: &[u8],
sig: &Self::AggregateSignature
) -> bool
fn verify_aggregate(
&self,
signers: &[Self::ValidatorId],
msg: &[u8],
sig: &Self::AggregateSignature
) -> bool
Verify an aggregate signature for the list of signers.