RecoverableSignature

Trait RecoverableSignature 

Source
pub trait RecoverableSignature: Sized {
    type PubKey;
    type Signer: RecoverableSigner<Sig = Self, PubKey = Self::PubKey>;
    type DefaultHash: HashFunction<32>;

    // Required method
    fn recover_with_hash<H: HashFunction<32>>(
        &self,
        msg: &[u8],
    ) -> Result<Self::PubKey, FastCryptoError>;

    // Provided method
    fn recover(&self, msg: &[u8]) -> Result<Self::PubKey, FastCryptoError> { ... }
}
Expand description

Trait impl’d by recoverable signatures

Required Associated Types§

Source

type PubKey

Source

type Signer: RecoverableSigner<Sig = Self, PubKey = Self::PubKey>

Source

type DefaultHash: HashFunction<32>

Required Methods§

Source

fn recover_with_hash<H: HashFunction<32>>( &self, msg: &[u8], ) -> Result<Self::PubKey, FastCryptoError>

Recover the public key from this signature. Assuming that the given hash function was used for signing.

Note: This is currently only used for Secp256r1 and Secp256k1 where the hash function must have 32 byte output.

Provided Methods§

Source

fn recover(&self, msg: &[u8]) -> Result<Self::PubKey, FastCryptoError>

Recover the public key from this signature.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§