Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps, improve tests #120

Merged
merged 20 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
with:
cache-on-failure: "true"
- name: Check docs
run: RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo +nightly doc --workspace --all-features --no-deps
run: RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps

bench:
runs-on: ubuntu-latest
Expand Down
83 changes: 9 additions & 74 deletions Cargo.lock

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

18 changes: 13 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ exclude = [
]

[workspace.dependencies]
cggmp21 = { version = "0.5", path = "cggmp21" }
cggmp21-keygen = { version = "0.4", path = "cggmp21-keygen" }
key-share = { version = "0.5", path = "key-share", default-features = false }
cggmp21 = { version = "0.6", path = "cggmp21" }
cggmp21-keygen = { version = "0.5", path = "cggmp21-keygen" }
key-share = { version = "0.6", path = "key-share", default-features = false }

generic-ec = { version = "0.4.1", default-features = false }
generic-ec-zkp = { version = "0.4.1", default-features = false }
round-based = { version = "0.3", default-features = false }
round-based = { version = "0.4", default-features = false }

paillier-zk = "0.4.1"
udigest = { version = "0.2.1", default-features = false }
Expand All @@ -41,6 +41,14 @@ serde_with = { version = "2", default-features = false }
serde_json = "1"
hex = { version = "0.4", default-features = false }

hd-wallet = { version = "0.5", default-features = false }
hd-wallet = { version = "0.6", default-features = false }

generic-tests = "0.1"

[patch.crates-io.hd-wallet]
git = "https://github.com/LFDT-Lockness/hd-wallet"
branch = "dt"

[patch.crates-io.round-based]
git = "https://github.com/LFDT-Lockness/round-based"
branch = "impr-sim"
5 changes: 5 additions & 0 deletions cggmp21-keygen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.5.0
* Update `hd-wallet` dep to v0.6 [#120]

[#120]: https://github.com/LFDT-Lockness/cggmp21/pull/120

## v0.4.0
* BREAKING: use `hd-wallet` crate for HD support instead of `slip-10` [#115]
* BREAKING: rename `hd-wallets` feature into `hd-wallet` [#115]
Expand Down
2 changes: 1 addition & 1 deletion cggmp21-keygen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cggmp21-keygen"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "UC-secure DKG implementation based on CGGMP21 paper"
Expand Down
5 changes: 5 additions & 0 deletions cggmp21/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.6.0
* Update `hd-wallet` dep to v0.6 [#120]

[#120]: https://github.com/LFDT-Lockness/cggmp21/pull/120

## v0.5.0
* BREAKING: use `hd-wallet` crate for HD support instead of `slip-10` [#115]
* BREAKING: rename `hd-wallets` feature into `hd-wallet` [#115]
Expand Down
12 changes: 7 additions & 5 deletions cggmp21/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cggmp21"
version = "0.5.0"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "TSS ECDSA implementation based on CGGMP21 paper"
Expand Down Expand Up @@ -38,7 +38,7 @@ hex = { workspace = true, default-features = false, features = ["serde"] }
hd-wallet = { workspace = true, optional = true, features = ["std"] }

[dev-dependencies]
round-based = { workspace = true, features = ["derive", "dev"] }
round-based = { workspace = true, features = ["derive", "sim"] }

rand = { workspace = true }
rand_dev = { workspace = true }
Expand All @@ -47,10 +47,12 @@ generic-tests = { workspace = true }

[features]
all-curves = ["curve-secp256k1", "curve-secp256r1", "curve-stark"]
curve-secp256k1 = ["generic-ec/curve-secp256k1"]
curve-secp256r1 = ["generic-ec/curve-secp256r1"]
curve-stark = ["generic-ec/curve-stark"]
curve-secp256k1 = ["generic-ec/curve-secp256k1", "hd-wallet?/curve-secp256k1"]
curve-secp256r1 = ["generic-ec/curve-secp256r1", "hd-wallet?/curve-secp256r1"]
curve-stark = ["generic-ec/curve-stark", "hd-wallet?/curve-stark"]
hd-wallet = ["dep:hd-wallet", "cggmp21-keygen/hd-wallet"]
hd-slip10 = ["hd-wallet/slip10"]
hd-stark = ["hd-wallet/stark"]
spof = ["key-share/spof"]

state-machine = ["cggmp21-keygen/state-machine"]
Expand Down
21 changes: 13 additions & 8 deletions cggmp21/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub struct PartialSignature<E: Curve> {
}

/// ECDSA signature
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Debug)]
#[serde(bound = "")]
pub struct Signature<E: Curve> {
/// $r$ component of signature
Expand Down Expand Up @@ -350,9 +350,10 @@ where
/// ```
///
/// ## Derivation algorithm
/// This method uses [`hd_wallet::Slip10Like`] derivation algorithm. If you need to use another one, see
/// This method uses [`hd_wallet::Slip10`] derivation algorithm, which can only be used with secp256k1
/// and secp256r1 curves. If you need to use another one, see
/// [`set_derivation_path_with_algo`](Self::set_derivation_path_with_algo)
#[cfg(feature = "hd-wallet")]
#[cfg(all(feature = "hd-wallet", feature = "hd-slip10"))]
pub fn set_derivation_path<Index>(
self,
path: impl IntoIterator<Item = Index>,
Expand All @@ -361,9 +362,10 @@ where
crate::key_share::HdError<<Index as TryInto<hd_wallet::NonHardenedIndex>>::Error>,
>
where
hd_wallet::Slip10: hd_wallet::HdWallet<E>,
hd_wallet::NonHardenedIndex: TryFrom<Index>,
{
self.set_derivation_path_with_algo::<hd_wallet::Slip10Like, _>(path)
self.set_derivation_path_with_algo::<hd_wallet::Slip10, _>(path)
}

/// Specifies HD derivation path, using HD derivation algorithm [`hd_wallet::HdWallet`]
Expand Down Expand Up @@ -1290,18 +1292,21 @@ impl<E: Curve> Presignature<E> {
/// assoicated with the key share that was used to generate presignature.
/// Using wrong `epub` will simply lead to invalid signature.
///
/// For HD derivation, uses [`hd_wallet::Slip10Like`] algorithm. If you need to
/// use another derivation algorithm, see [`set_derivation_path_with_algo`](Self::set_derivation_path_with_algo)
#[cfg(feature = "hd-wallet")]
/// ## Derivation algorithm
/// This method uses [`hd_wallet::Slip10`] derivation algorithm, which can only be used with secp256k1
/// and secp256r1 curves. If you need to use another one, see
/// [`set_derivation_path_with_algo`](Self::set_derivation_path_with_algo)
#[cfg(all(feature = "hd-wallet", feature = "hd-slip10"))]
pub fn set_derivation_path<Index>(
self,
epub: hd_wallet::ExtendedPublicKey<E>,
derivation_path: impl IntoIterator<Item = Index>,
) -> Result<Self, <Index as TryInto<hd_wallet::NonHardenedIndex>>::Error>
where
hd_wallet::Slip10: hd_wallet::HdWallet<E>,
hd_wallet::NonHardenedIndex: TryFrom<Index>,
{
self.set_derivation_path_with_algo::<hd_wallet::Slip10Like, _>(epub, derivation_path)
self.set_derivation_path_with_algo::<hd_wallet::Slip10, _>(epub, derivation_path)
}

/// Specifies HD derivation path
Expand Down
5 changes: 5 additions & 0 deletions key-share/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.6.0
* Update `hd-wallet` dep to v0.6 [#120]

[#120]: https://github.com/LFDT-Lockness/cggmp21/pull/120

## v0.5.0
* BREAKING: use `hd-wallet` crate for HD support instead of `slip-10` [#115]
* BREAKING: rename `hd-wallets` feature into `hd-wallet` [#115]
Expand Down
2 changes: 1 addition & 1 deletion key-share/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "key-share"
version = "0.5.0"
version = "0.6.0"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Key share of any Threshold Signature Scheme (TSS)"
Expand Down
9 changes: 2 additions & 7 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ rand_dev = { workspace = true }

sha2 = { workspace = true }

round-based = { workspace = true, features = ["derive", "dev", "state-machine"] }
round-based = { workspace = true, features = ["derive", "sim", "state-machine"] }
generic-ec = { workspace = true, features = ["serde", "all-curves"] }

bpaf = "0.7"
include_dir = "0.7"
ciborium = "0.2"

tokio = { version = "1", features = ["macros"] }
futures = "0.3"

lazy_static = "1.4"
Expand All @@ -40,12 +39,8 @@ starknet-providers = { version = "0.6" }
starknet-signers = { version = "0.4" }
url = "2.4"

[dev-dependencies]
generic-tests = "0.1"
test-case = "3"

[features]
hd-wallet = ["cggmp21/hd-wallet"]
hd-wallet = ["cggmp21/hd-wallet", "cggmp21/hd-slip10", "cggmp21/hd-stark"]

[[bin]]
name = "precompute_shares"
Expand Down
Loading