pub trait SignatureScheme: Send + Sync {
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(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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".