SignatureDerive

Trait SignatureDerive 

Source
pub trait SignatureDerive: Signature {
    const MIN_SEED_SIZE: usize;

    // Required methods
    fn derive_keypair(seed: &[u8]) -> Result<Self::KeyPair>;
    fn derive_public_key(
        secret_key: &Self::SecretKey,
    ) -> Result<Self::PublicKey>;
}
Expand description

Optional trait for signature algorithms that support key derivation

This trait is for algorithms that can derive keys from seed material in a deterministic way.

Required Associated Constants§

Source

const MIN_SEED_SIZE: usize

Minimum seed size in bytes

Required Methods§

Source

fn derive_keypair(seed: &[u8]) -> Result<Self::KeyPair>

Derive a key pair from seed material

§Security Requirements
  • The seed must have sufficient entropy
  • Derivation must be deterministic
  • Same seed must always produce same key pair
§Errors

Returns an error if the seed is too short or invalid

Source

fn derive_public_key(secret_key: &Self::SecretKey) -> Result<Self::PublicKey>

Derive the public key from a secret key

This is useful when you have a secret key and need to recover the corresponding public key.

§Errors

Returns an error if the secret key is invalid

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§