mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-21 16:51:03 +00:00
Encryption support for the statement store (#14440)
* Added ECIES encryption * tweaks * fmt * Make clippy happy * Use local keystore * qed
This commit is contained in:
@@ -57,7 +57,6 @@ sp-runtime-interface = { version = "17.0.0", default-features = false, path = ".
|
||||
w3f-bls = { version = "0.1.3", default-features = false, optional = true}
|
||||
|
||||
[dev-dependencies]
|
||||
rand = "0.8.5"
|
||||
criterion = "0.4.0"
|
||||
serde_json = "1.0"
|
||||
sp-core-hashing-proc-macro = { version = "9.0.0", path = "./hashing/proc-macro" }
|
||||
|
||||
@@ -422,12 +422,8 @@ impl TraitPair for Pair {
|
||||
///
|
||||
/// Returns true if the signature is good.
|
||||
fn verify<M: AsRef<[u8]>>(sig: &Self::Signature, message: M, public: &Self::Public) -> bool {
|
||||
let Ok(public) = VerificationKey::try_from(public.as_slice()) else {
|
||||
return false
|
||||
};
|
||||
let Ok(signature) = ed25519_zebra::Signature::try_from(sig.as_ref()) else {
|
||||
return false
|
||||
};
|
||||
let Ok(public) = VerificationKey::try_from(public.as_slice()) else { return false };
|
||||
let Ok(signature) = ed25519_zebra::Signature::try_from(sig.as_ref()) else { return false };
|
||||
public.verify(&signature, message.as_ref()).is_ok()
|
||||
}
|
||||
|
||||
|
||||
@@ -505,12 +505,8 @@ impl TraitPair for Pair {
|
||||
}
|
||||
|
||||
fn verify<M: AsRef<[u8]>>(sig: &Self::Signature, message: M, pubkey: &Self::Public) -> bool {
|
||||
let Ok(signature) = schnorrkel::Signature::from_bytes(sig.as_ref()) else {
|
||||
return false
|
||||
};
|
||||
let Ok(public) = PublicKey::from_bytes(pubkey.as_ref()) else {
|
||||
return false
|
||||
};
|
||||
let Ok(signature) = schnorrkel::Signature::from_bytes(sig.as_ref()) else { return false };
|
||||
let Ok(public) = PublicKey::from_bytes(pubkey.as_ref()) else { return false };
|
||||
public.verify_simple(SIGNING_CTX, message.as_ref(), &signature).is_ok()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user