Verifier

Trait Verifier 

Source
pub trait Verifier {
    type Signature: Signature;

    // Required method
    fn verify(
        &self,
        namespace: Option<&[u8]>,
        msg: &[u8],
        sig: &Self::Signature,
    ) -> bool;
}
Expand description

Verifies Signatures over messages.

Required Associated Types§

Source

type Signature: Signature

The type of Signature that this verifier can verify.

Required Methods§

Source

fn verify( &self, namespace: Option<&[u8]>, msg: &[u8], sig: &Self::Signature, ) -> bool

Verify that a Signature is a valid over a given message.

The message should not be hashed prior to calling this function. If a particular scheme requires a payload to be hashed before it is signed, it will be done internally.

Because namespace is prepended to message before signing, the namespace provided here must match the namespace provided during signing.

Implementors§

Source§

impl Verifier for commonware_cryptography::bls12381::PublicKey

Source§

impl Verifier for commonware_cryptography::ed25519::PublicKey

Source§

impl Verifier for commonware_cryptography::secp256r1::PublicKey