pub trait EcdsaEngine {
// Required methods
fn sign_hash(
hash: &HashBase<CoreWrapper<Keccak256Core>>,
chain_keypair: &ChainKeypair,
) -> Result<([u8; 64], u8), CryptoError>;
fn verify_hash(
signature: &([u8; 64], u8),
hash: &HashBase<CoreWrapper<Keccak256Core>>,
public_key: &PublicKey,
) -> Result<bool, CryptoError>;
fn recover_from_hash(
signature: &([u8; 64], u8),
hash: &HashBase<CoreWrapper<Keccak256Core>>,
) -> Result<PublicKey, CryptoError>;
}Expand description
Trait for ECDSA signature engines.
Required Methods§
Sourcefn sign_hash(
hash: &HashBase<CoreWrapper<Keccak256Core>>,
chain_keypair: &ChainKeypair,
) -> Result<([u8; 64], u8), CryptoError>
fn sign_hash( hash: &HashBase<CoreWrapper<Keccak256Core>>, chain_keypair: &ChainKeypair, ) -> Result<([u8; 64], u8), CryptoError>
Sign the given hash with the private key from the chain_keypair.
Sourcefn verify_hash(
signature: &([u8; 64], u8),
hash: &HashBase<CoreWrapper<Keccak256Core>>,
public_key: &PublicKey,
) -> Result<bool, CryptoError>
fn verify_hash( signature: &([u8; 64], u8), hash: &HashBase<CoreWrapper<Keccak256Core>>, public_key: &PublicKey, ) -> Result<bool, CryptoError>
Verify the given signature against the hash and the public_key.
Sourcefn recover_from_hash(
signature: &([u8; 64], u8),
hash: &HashBase<CoreWrapper<Keccak256Core>>,
) -> Result<PublicKey, CryptoError>
fn recover_from_hash( signature: &([u8; 64], u8), hash: &HashBase<CoreWrapper<Keccak256Core>>, ) -> Result<PublicKey, CryptoError>
Recover the signer public key from the signature and the hash.
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.