pub trait SealWitness<Seal> {
    type Message;
    type Error: Error;

    // Required method
    fn verify_seal(
        &self,
        seal: &Seal,
        msg: &Self::Message
    ) -> Result<bool, Self::Error>;

    // Provided method
    fn verify_many_seals<'seal>(
        &self,
        seals: impl IntoIterator<Item = &'seal Seal>,
        msg: &Self::Message
    ) -> Result<bool, Self::Error>
       where Seal: 'seal { ... }
}
Expand description

Seal witness which can verify seal or multiple seals.

Required Associated Types§

source

type Message

Message type that is supported by the current single-use-seal

source

type Error: Error

Error type that contains reasons of medium access failure

Required Methods§

source

fn verify_seal( &self, seal: &Seal, msg: &Self::Message ) -> Result<bool, Self::Error>

Verifies that the seal was indeed closed over the message with the provided seal closure witness.

Provided Methods§

source

fn verify_many_seals<'seal>( &self, seals: impl IntoIterator<Item = &'seal Seal>, msg: &Self::Message ) -> Result<bool, Self::Error>
where Seal: 'seal,

Performs batch verification of the seals.

Default implementation iterates through the seals and calls Self::verify_seal for each of them, returning false on first failure (not verifying the rest of seals).

Object Safety§

This trait is not object safe.

Implementors§