- pub(crate) fn into_rust(&self) -> SecpSignature {
- SecpSignature::from_compact(&self.compact_form).unwrap()
+ pub(crate) fn into_rust(&self) -> ECDSASecpSignature {
+ ECDSASecpSignature::from_compact(&self.compact_form).unwrap()
+ }
+}
+
+#[repr(C)]
+#[derive(Clone)]
+/// Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
+pub struct SchnorrSignature {
+ /// The bytes of the signature as two 32-byte numbers
+ pub compact_form: [u8; 64],
+}
+impl SchnorrSignature {
+ pub(crate) fn from_rust(pk: &SchnorrSecpSignature) -> Self {
+ Self {
+ compact_form: pk.as_ref().clone(),
+ }
+ }
+ pub(crate) fn into_rust(&self) -> SchnorrSecpSignature {
+ SchnorrSecpSignature::from_slice(&self.compact_form).unwrap()