Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions stacks-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ slog-term = { version = "2.6.0", default-features = false }
thiserror = { workspace = true }

# RustCrypto elliptic curve crates
k256 = { version = "0.13", default-features = false, features = ["std", "serde", "ecdsa"] }
p256 = { version = "0.13", default-features = false, features = ["std", "serde", "ecdsa"] }

# Optional dependencies
Expand All @@ -65,8 +64,12 @@ winapi = { version = "0.3", features = [
], optional = true }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
secp256k1 = { version = "0.24.3", default-features = false, features = ["std","serde", "recovery"] }
rusqlite = { workspace = true, optional = true }

[target.'cfg(target_family = "wasm")'.dependencies]
libsecp256k1 = { version = "0.7.2", default-features = false, features = ["hmac", "lazy-static-context"] }

[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(any(target_os="windows"))))'.dependencies]
sha2 = { version = "0.10", features = ["asm"] }

Expand Down Expand Up @@ -99,5 +102,5 @@ bech32_std = []
bech32_strict = []

# Wasm-specific features for easier configuration
wasm-web = ["rand", "getrandom/js"]
wasm-web = ["rand", "getrandom/js", "libsecp256k1/static-context"]
wasm-deterministic = ["getrandom/custom"]
6 changes: 6 additions & 0 deletions stacks-common/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ pub trait PublicKey: Clone + fmt::Debug + serde::Serialize + serde::de::Deserial
pub trait PrivateKey: Clone + fmt::Debug + serde::Serialize + serde::de::DeserializeOwned {
fn to_bytes(&self) -> Vec<u8>;
fn sign(&self, data_hash: &[u8]) -> Result<MessageSignature, &'static str>;
#[cfg(any(test, feature = "testing"))]
fn sign_with_noncedata(
&self,
data_hash: &[u8],
noncedata: &[u8; 32],
) -> Result<MessageSignature, &'static str>;
}

pub trait Address: Clone + fmt::Debug + fmt::Display {
Expand Down
Loading