pub trait AggregateAuthenticator: 'static + Display + Default + Serialize + DeserializeOwned + Send + Sync + Clone {
type Sig: Authenticator
where
<Self::Sig as Authenticator>::PubKey == Self::PubKey;
type PubKey: VerifyingKey
where
<Self::PubKey as VerifyingKey>::Sig == Self::Sig;
type PrivKey: SigningKey
where
<Self::PrivKey as SigningKey>::Sig == Self::Sig;
fn aggregate(signatures: Vec<Self::Sig, Global>) -> Result<Self, Error>;
fn add_signature(&mut self, signature: Self::Sig) -> Result<(), Error>;
fn add_aggregate(&mut self, signature: Self) -> Result<(), Error>;
fn verify(
&self,
pks: &[<Self::Sig as Authenticator>::PubKey],
message: &[u8]
) -> Result<(), Error>;
fn batch_verify<'a>(
sigs: &[&Self],
pks: Vec<impl ExactSizeIterator<Item = &'a Self::PubKey>, Global>,
messages: &[&[u8]]
) -> Result<(), Error>;
}
Expand description
Trait impl’d by aggregated signatures in asymmetric cryptography.
The trait bounds are implemented to allow the aggregation of multiple signatures, and to verify it against multiple, unaggregated public keys. For signature schemes where aggregation is not possible, a trivial implementation is provided.
Required Associated Types
type Sig: Authenticator
where
<Self::Sig as Authenticator>::PubKey == Self::PubKey
type PubKey: VerifyingKey
where
<Self::PubKey as VerifyingKey>::Sig == Self::Sig
type PrivKey: SigningKey
where
<Self::PrivKey as SigningKey>::Sig == Self::Sig
Required Methods
Parse a key from its byte representation