mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
Introduce Ristretto signing (#1730)
* first draft of ristretto crypto module #1685 * adds better comments and code-style * remove the last evil unwrap * remove a mistakenly committed lockfile * add a fresh new lockfile --will probably need a manual merge later * fix an invalid old test vector * Wire in ristretto * Update comment * Fix use. * new Signature type api alias to be compatible with substrate * Add new keyring, fix node executor tests * Bump version. * Remove all hashes. * Update core/primitives/src/sr25519.rs Co-Authored-By: gavofyork <github@gavwood.com> * Revert back to Ed25519 (until JS UI is ready) * Fix test
This commit is contained in:
@@ -266,6 +266,24 @@ impl From<H512> for Ed25519Signature {
|
||||
}
|
||||
}
|
||||
|
||||
/// Sr25519 signature verify.
|
||||
#[derive(Eq, PartialEq, Clone, Default, Encode, Decode)]
|
||||
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
|
||||
pub struct Sr25519Signature(pub H512);
|
||||
|
||||
impl Verify for Sr25519Signature {
|
||||
type Signer = H256;
|
||||
fn verify<L: Lazy<[u8]>>(&self, mut msg: L, signer: &Self::Signer) -> bool {
|
||||
runtime_io::sr25519_verify((self.0).as_fixed_bytes(), msg.get(), &signer.as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<H512> for Sr25519Signature {
|
||||
fn from(h: H512) -> Sr25519Signature {
|
||||
Sr25519Signature(h)
|
||||
}
|
||||
}
|
||||
|
||||
/// Context for executing a call into the runtime.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Encode, Decode)]
|
||||
#[cfg_attr(feature = "std", derive(Debug, Serialize))]
|
||||
|
||||
Reference in New Issue
Block a user