Skip to main content

RecoverableCurve

Trait RecoverableCurve 

Source
pub trait RecoverableCurve: Curve {
    type RecoveryId;

    // Required method
    fn recover(
        msg: &[u8],
        signature: &Self::Signature,
        recovery_id: Self::RecoveryId,
    ) -> Option<Self::PublicKey>;
}
Expand description

A recoverable curve.

Required Associated Types§

Source

type RecoveryId

An additional information required to recover the public key.

Required Methods§

Source

fn recover( msg: &[u8], signature: &Self::Signature, recovery_id: Self::RecoveryId, ) -> Option<Self::PublicKey>

Try to recover public key which signed given message and produced given signature along with a recovery id

NOTE: implementations MAY require msg to be prehash (i.e. output of cryptographic hash function) of a fixed length and reject the signature otherwise. Check corresponding docs before using.

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§