Trait tendermint_machine::ext::SignatureScheme
source · pub trait SignatureScheme: Send + Sync + Clone {
type ValidatorId: ValidatorId;
type Signature: Signature;
type AggregateSignature: Signature;
type Signer: Signer<ValidatorId = Self::ValidatorId, Signature = Self::Signature>;
// Required methods
fn verify(
&self,
validator: Self::ValidatorId,
msg: &[u8],
sig: &Self::Signature,
) -> bool;
fn aggregate(
&self,
validators: &[Self::ValidatorId],
msg: &[u8],
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(
&self,
validators: &[Self::ValidatorId],
msg: &[u8],
sigs: &[Self::Signature],
) -> Self::AggregateSignature
fn aggregate( &self, validators: &[Self::ValidatorId], msg: &[u8], sigs: &[Self::Signature], ) -> Self::AggregateSignature
Aggregate signatures. It may panic if corrupted data passed in.
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.
Object Safety§
This trait is not object safe.