mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 04:31:08 +00:00
Add CryptoStore::ecdsa_sign_prehashed() (#8838)
* Pair::sign_prehashed() * add CryptoStore::ecdsa_sign_prehashed() * add test for testing keystore * address review comments
This commit is contained in:
@@ -194,6 +194,20 @@ pub trait CryptoStore: Send + Sync {
|
||||
public: &sr25519::Public,
|
||||
transcript_data: VRFTranscriptData,
|
||||
) -> Result<Option<VRFSignature>, Error>;
|
||||
|
||||
/// Sign pre-hashed
|
||||
///
|
||||
/// Signs a pre-hashed message with the private key that matches
|
||||
/// the ECDSA public key passed.
|
||||
///
|
||||
/// Returns the SCALE encoded signature if key is found and supported,
|
||||
/// `None` if the key doesn't exist or an error when something failed.
|
||||
async fn ecdsa_sign_prehashed(
|
||||
&self,
|
||||
id: KeyTypeId,
|
||||
public: &ecdsa::Public,
|
||||
msg: &[u8; 32],
|
||||
) -> Result<Option<ecdsa::Signature>, Error>;
|
||||
}
|
||||
|
||||
/// Sync version of the CryptoStore
|
||||
@@ -353,6 +367,20 @@ pub trait SyncCryptoStore: CryptoStore + Send + Sync {
|
||||
public: &sr25519::Public,
|
||||
transcript_data: VRFTranscriptData,
|
||||
) -> Result<Option<VRFSignature>, Error>;
|
||||
|
||||
/// Sign pre-hashed
|
||||
///
|
||||
/// Signs a pre-hashed message with the private key that matches
|
||||
/// the ECDSA public key passed.
|
||||
///
|
||||
/// Returns the SCALE encoded signature if key is found and supported,
|
||||
/// `None` if the key doesn't exist or an error when something failed.
|
||||
fn ecdsa_sign_prehashed(
|
||||
&self,
|
||||
id: KeyTypeId,
|
||||
public: &ecdsa::Public,
|
||||
msg: &[u8; 32],
|
||||
) -> Result<Option<ecdsa::Signature>, Error>;
|
||||
}
|
||||
|
||||
/// A pointer to a keystore.
|
||||
|
||||
Reference in New Issue
Block a user