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§

source

type ValidatorId: ValidatorId

source

type Signature: Signature

Signature type.

source

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.

source

type Signer: Signer<ValidatorId = Self::ValidatorId, Signature = Self::Signature>

Type representing a signer of this scheme.

Required Methods§

source

fn verify( &self, validator: Self::ValidatorId, msg: &[u8], sig: &Self::Signature, ) -> bool

Verify a signature from the validator in question.

source

fn aggregate( &self, validators: &[Self::ValidatorId], msg: &[u8], sigs: &[Self::Signature], ) -> Self::AggregateSignature

Aggregate signatures. It may panic if corrupted data passed in.

source

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.

Implementations on Foreign Types§

source§

impl<S: SignatureScheme> SignatureScheme for Arc<S>

§

type ValidatorId = <S as SignatureScheme>::ValidatorId

§

type Signature = <S as SignatureScheme>::Signature

§

type AggregateSignature = <S as SignatureScheme>::AggregateSignature

§

type Signer = <S as SignatureScheme>::Signer

source§

fn verify( &self, validator: Self::ValidatorId, msg: &[u8], sig: &Self::Signature, ) -> bool

source§

fn aggregate( &self, validators: &[Self::ValidatorId], msg: &[u8], sigs: &[Self::Signature], ) -> Self::AggregateSignature

source§

fn verify_aggregate( &self, signers: &[Self::ValidatorId], msg: &[u8], sig: &Self::AggregateSignature, ) -> bool

Implementors§