Skip to content

Commit 738f292

Browse files
update frost-* dependencies to 2.1
1 parent 06f5576 commit 738f292

File tree

8 files changed

+183
-35
lines changed

8 files changed

+183
-35
lines changed

Cargo.lock

+43-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+10-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"roast-ristretto255",
99
"roast-secp256k1",
1010
"roast-secp256k1-evm",
11+
"roast-secp256k1-tr",
1112
]
1213

1314
[workspace.package]
@@ -25,13 +26,14 @@ aes = { version = "0.8", features = ["zeroize"], default-features = false }
2526
ctr = { version = "0.9", features = ["zeroize"], default-features = false }
2627
digest = { version = "0.10", default-features = false }
2728
document-features = "0.2"
28-
frost-core = { version = "2.0", features = ["internals"], default-features = false }
29-
frost-ed25519 = { version = "2.0", default-features = false }
30-
frost-ed448 = { version = "2.0", default-features = false }
31-
frost-p256 = { version = "2.0", default-features = false }
32-
frost-ristretto255 = { version = "2.0", default-features = false }
33-
frost-secp256k1 = { version = "2.0", default-features = false }
34-
frost-secp256k1-evm = { version = "2.0", default-features = false }
29+
frost-core = { version = "2.1", features = ["internals"], default-features = false }
30+
frost-ed25519 = { version = "2.1", default-features = false }
31+
frost-ed448 = { version = "2.1", default-features = false }
32+
frost-p256 = { version = "2.1", default-features = false }
33+
frost-ristretto255 = { version = "2.1", default-features = false }
34+
frost-secp256k1 = { version = "2.1", default-features = false }
35+
frost-secp256k1-evm = { version = "2.1", default-features = false }
36+
frost-secp256k1-tr = { version = "2.1", default-features = false }
3537
hkdf = { version = "0.12", default-features = false }
3638
rand = { version = "0.8", default-features = false }
3739
rand_core = { version = "0.6", default-features = false }
@@ -47,3 +49,4 @@ roast-p256 = { path = "roast-p256", default-features = false }
4749
roast-ristretto255 = { path = "roast-ristretto255", default-features = false }
4850
roast-secp256k1 = { path = "roast-secp256k1", default-features = false }
4951
roast-secp256k1-evm = { path = "roast-secp256k1-evm", default-features = false }
52+
roast-secp256k1-tr = { path = "roast-secp256k1-tr", default-features = false }

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
[![Build Status](https://github.com/StackOverflowExcept1on/roast/workflows/CI/badge.svg)](https://github.com/StackOverflowExcept1on/roast/actions)
44

5-
| Crate | Description |
6-
|----------------------------------------------|------------------------------|
7-
| [`roast-core`](roast-core) | Generic ROAST implementation |
8-
| [`roast-ed25519`](roast-ed25519) | Ed25519 ciphersuite |
9-
| [`roast-ed448`](roast-ed448) | Ed448 ciphersuite |
10-
| [`roast-p256`](roast-ed448) | P-256 ciphersuite |
11-
| [`roast-ristretto255`](roast-ristretto255) | Ristretto255 ciphersuite |
12-
| [`roast-secp256k1`](roast-secp256k1) | secp256k1 ciphersuite |
13-
| [`roast-secp256k1-evm`](roast-secp256k1-evm) | secp256k1 ciphersuite (EVM) |
5+
| Crate | Description |
6+
|----------------------------------------------|---------------------------------|
7+
| [`roast-core`](roast-core) | Generic ROAST implementation |
8+
| [`roast-ed25519`](roast-ed25519) | Ed25519 ciphersuite |
9+
| [`roast-ed448`](roast-ed448) | Ed448 ciphersuite |
10+
| [`roast-p256`](roast-ed448) | P-256 ciphersuite |
11+
| [`roast-ristretto255`](roast-ristretto255) | Ristretto255 ciphersuite |
12+
| [`roast-secp256k1`](roast-secp256k1) | secp256k1 ciphersuite |
13+
| [`roast-secp256k1-evm`](roast-secp256k1-evm) | secp256k1 ciphersuite (EVM) |
14+
| [`roast-secp256k1-tr`](roast-secp256k1-tr) | secp256k1 ciphersuite (Taproot) |
1415

1516
Rust implementation of [ROAST (Robust Asynchronous Schnorr Threshold Signatures)](https://eprint.iacr.org/2022/550)
1617
with [cryptography by Zcash Foundation](https://github.com/ZcashFoundation/frost).

roast-core/src/dkg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<C: Ciphersuite, H: Clone + BlockSizeUser + Digest> Participant<C, H> {
568568
return Err(DkgParticipantError::InvalidSecretShares);
569569
}
570570

571-
signing_share = signing_share + *round2_secret_package.secret_share();
571+
signing_share = signing_share + round2_secret_package.secret_share();
572572
let signing_share = SigningShare::new(signing_share);
573573

574574
let verifying_share = signing_share.into();

roast-secp256k1-tr/Cargo.toml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package]
2+
name = "roast-secp256k1-tr"
3+
version.workspace = true
4+
authors.workspace = true
5+
edition.workspace = true
6+
rust-version.workspace = true
7+
description = "A Schnorr signature scheme over the secp256k1 curve that supports ROAST and Taproot."
8+
readme.workspace = true
9+
repository.workspace = true
10+
license.workspace = true
11+
keywords = ["cryptography", "crypto", "secp256k1", "threshold", "signature"]
12+
categories.workspace = true
13+
14+
[dependencies]
15+
document-features.workspace = true
16+
frost-secp256k1-tr.workspace = true
17+
roast-core.workspace = true
18+
sha2.workspace = true
19+
20+
[dev-dependencies]
21+
roast-core = { workspace = true, features = ["test-impl"] }
22+
rand_core = { workspace = true, features = ["getrandom"] }
23+
24+
[features]
25+
default = ["serialization", "cheater-detection", "std"]
26+
#! ## Features
27+
## Enable standard library support.
28+
std = ["roast-core/std"]
29+
## Enable `serde` support for types that need to be communicated. You
30+
## can use `serde` to serialize structs with any encoder that supports
31+
## `serde` (e.g. JSON with `serde_json`).
32+
serde = ["roast-core/serde"]
33+
## Enable a default serialization format. Enables `serde`.
34+
serialization = ["roast-core/serialization"]
35+
## Enable cheater detection.
36+
cheater-detection = ["roast-core/cheater-detection"]

roast-secp256k1-tr/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
An implementation of Schnorr signatures on the secp256k1 curve (Taproot) for threshold numbers of signers (ROAST).

roast-secp256k1-tr/src/lib.rs

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#![cfg_attr(not(feature = "std"), no_std)]
2+
#![deny(missing_docs)]
3+
#![doc = include_str!("../README.md")]
4+
#![doc = document_features::document_features!()]
5+
6+
mod coordinator {
7+
/// Represents all possible session statuses.
8+
pub type SessionStatus = roast_core::SessionStatus<frost_secp256k1_tr::Secp256K1Sha256TR>;
9+
10+
/// Represents coordinator.
11+
pub type Coordinator = roast_core::Coordinator<frost_secp256k1_tr::Secp256K1Sha256TR>;
12+
}
13+
14+
pub mod dkg {
15+
//! Distributed Key Generation types.
16+
17+
pub use roast_core::dkg::DkgStatus;
18+
19+
/// Represents dealer that can be used for Distributed Key Generation.
20+
pub type Dealer = roast_core::dkg::Dealer<frost_secp256k1_tr::Secp256K1Sha256TR, sha2::Sha256>;
21+
22+
/// Represents participant of Distributed Key Generation.
23+
pub type Participant =
24+
roast_core::dkg::Participant<frost_secp256k1_tr::Secp256K1Sha256TR, sha2::Sha256>;
25+
}
26+
27+
pub mod error {
28+
//! Error types.
29+
30+
/// Represents all possible errors that can occur in FROST protocol.
31+
pub type FrostError = frost_secp256k1_tr::Error;
32+
33+
/// Represents all possible errors that can occur in Distributed Key
34+
/// Generation protocol on dealer side.
35+
pub type DkgDealerError =
36+
roast_core::error::DkgDealerError<frost_secp256k1_tr::Secp256K1Sha256TR>;
37+
38+
/// Represents all possible errors that can occur in Distributed Key
39+
/// Generation protocol on participant side.
40+
pub type DkgParticipantError =
41+
roast_core::error::DkgParticipantError<frost_secp256k1_tr::Secp256K1Sha256TR>;
42+
43+
pub use roast_core::error::MaliciousSignerError;
44+
45+
/// Represents all possible errors that can occur in ROAST protocol.
46+
pub type RoastError = roast_core::error::RoastError<frost_secp256k1_tr::Secp256K1Sha256TR>;
47+
}
48+
49+
mod signer {
50+
/// Represents signer.
51+
pub type Signer = roast_core::Signer<frost_secp256k1_tr::Secp256K1Sha256TR>;
52+
}
53+
54+
pub use frost_secp256k1_tr as frost;
55+
56+
pub use coordinator::*;
57+
pub use signer::*;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
use roast_core::{error::DkgError, tests};
2+
use roast_secp256k1_tr::{error::RoastError, frost::rand_core::OsRng};
3+
4+
#[test]
5+
fn test_dkg_basic() -> Result<(), DkgError<frost_secp256k1_tr::Secp256K1Sha256TR>> {
6+
let mut rng = OsRng;
7+
tests::test_dkg_basic::<_, sha2::Sha256, _>(2, 3, &mut rng)?;
8+
Ok(())
9+
}
10+
11+
#[test]
12+
fn test_basic() -> Result<(), RoastError> {
13+
let mut rng = OsRng;
14+
tests::test_basic(2, 3, &mut rng)?;
15+
tests::test_basic(67, 100, &mut rng)?;
16+
Ok(())
17+
}
18+
19+
#[test]
20+
fn test_malicious() -> Result<(), RoastError> {
21+
let mut rng = OsRng;
22+
tests::test_malicious(2, 3, 1, &mut rng)?;
23+
tests::test_malicious(67, 100, 33, &mut rng)?;
24+
Ok(())
25+
}

0 commit comments

Comments
 (0)