mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +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:
@@ -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