|
1 | 1 | #[cfg(not(feature = "wasm"))]
|
2 | 2 | mod secp256k1;
|
3 | 3 |
|
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 |
| - |
11 | 4 | #[cfg(not(feature = "wasm"))]
|
12 | 5 | pub use self::secp256k1::*;
|
13 | 6 |
|
@@ -38,30 +31,3 @@ impl Default for SchnorrSignature {
|
38 | 31 | Self([0u8; 65])
|
39 | 32 | }
|
40 | 33 | }
|
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