From 7514f2ca18966878ea3726e6530c21890181d533 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 13 Jan 2022 17:40:27 +0100 Subject: [PATCH] Tweaked -> untweaked keys conversions --- src/util/schnorr.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/util/schnorr.rs b/src/util/schnorr.rs index 8a1d8f9a..ee030275 100644 --- a/src/util/schnorr.rs +++ b/src/util/schnorr.rs @@ -189,6 +189,20 @@ impl TweakedKeyPair { } } +impl From for XOnlyPublicKey { + #[inline] + fn from(pair: TweakedPublicKey) -> Self { + pair.0 + } +} + +impl From for KeyPair { + #[inline] + fn from(pair: TweakedKeyPair) -> Self { + pair.0 + } +} + /// A BIP340-341 serialized schnorr signature with the corresponding hash type. #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]