Skip to content

Commit 2d287f0

Browse files
committed
fix: remove wsts library
1 parent 58d2fb2 commit 2d287f0

File tree

1 file changed

+0
-34
lines changed
  • stacks-common/src/util/secp256k1

1 file changed

+0
-34
lines changed
Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
#[cfg(not(feature = "wasm"))]
22
mod secp256k1;
33

4-
#[cfg(not(feature = "wasm"))]
5-
use wsts::common::Signature as WSTSSignature;
6-
#[cfg(not(feature = "wasm"))]
7-
use wsts::curve::point::{Compressed, Point};
8-
#[cfg(not(feature = "wasm"))]
9-
use wsts::curve::scalar::Scalar;
10-
114
#[cfg(not(feature = "wasm"))]
125
pub use self::secp256k1::*;
136

@@ -38,30 +31,3 @@ impl Default for SchnorrSignature {
3831
Self([0u8; 65])
3932
}
4033
}
41-
42-
#[cfg(not(feature = "wasm"))]
43-
impl SchnorrSignature {
44-
/// Attempt to convert a Schnorr signature to a WSTS Signature
45-
pub fn to_wsts_signature(&self) -> Option<WSTSSignature> {
46-
// TODO: update wsts to add a TryFrom for a [u8; 65] and a slice to a Signature
47-
let point_bytes: [u8; 33] = self.0[..33].try_into().ok()?;
48-
let scalar_bytes: [u8; 32] = self.0[33..].try_into().ok()?;
49-
let point = Point::try_from(&Compressed::from(point_bytes)).ok()?;
50-
let scalar = Scalar::from(scalar_bytes);
51-
Some(WSTSSignature {
52-
R: point,
53-
z: scalar,
54-
})
55-
}
56-
}
57-
58-
#[cfg(not(feature = "wasm"))]
59-
/// Convert a WSTS Signature to a SchnorrSignature
60-
impl From<&WSTSSignature> for SchnorrSignature {
61-
fn from(signature: &WSTSSignature) -> Self {
62-
let mut buf = [0u8; 65];
63-
buf[..33].copy_from_slice(&signature.R.compress().data);
64-
buf[33..].copy_from_slice(&signature.z.to_bytes());
65-
SchnorrSignature(buf)
66-
}
67-
}

0 commit comments

Comments
 (0)