From 0fd3f034f1d94fb672ec0f89bdcaef1f15278fd9 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 21 Jan 2025 09:59:27 +0300 Subject: [PATCH] feat: switch to frost fork with no_std support and additional trait bounds --- Cargo.toml | 19 ++++--- roast-core/Cargo.toml | 7 +-- roast-core/src/dkg.rs | 51 ++++++++----------- roast-core/src/error.rs | 16 ------ roast-core/src/lib.rs | 2 +- roast-core/src/tests.rs | 7 +-- roast-ed25519/Cargo.toml | 4 +- roast-ed25519/src/lib.rs | 2 +- roast-ed25519/tests/integration_tests.rs | 6 +-- roast-ed448/Cargo.toml | 4 +- roast-ed448/src/lib.rs | 2 +- roast-p256/Cargo.toml | 4 +- roast-p256/src/lib.rs | 2 +- roast-p256/tests/integration_tests.rs | 6 +-- roast-ristretto255/Cargo.toml | 4 +- roast-ristretto255/src/lib.rs | 2 +- roast-ristretto255/tests/integration_tests.rs | 8 +-- roast-secp256k1-evm/Cargo.toml | 4 +- roast-secp256k1-evm/src/lib.rs | 2 +- .../tests/integration_tests.rs | 8 +-- roast-secp256k1-tr/Cargo.toml | 4 +- roast-secp256k1-tr/src/lib.rs | 2 +- roast-secp256k1-tr/tests/integration_tests.rs | 8 +-- roast-secp256k1/Cargo.toml | 4 +- roast-secp256k1/src/lib.rs | 2 +- roast-secp256k1/tests/integration_tests.rs | 6 +-- 26 files changed, 74 insertions(+), 112 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index faf5aad..5d1e0e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,21 +26,20 @@ aes = { version = "0.8", features = ["zeroize"], default-features = false } ctr = { version = "0.9", features = ["zeroize"], default-features = false } digest = { version = "0.10", default-features = false } document-features = "0.2" -frost-core = { version = "2.1", features = ["internals"], default-features = false } -frost-ed25519 = { version = "2.1", default-features = false } -frost-ed448 = { version = "2.1", default-features = false } -frost-p256 = { version = "2.1", default-features = false } -frost-ristretto255 = { version = "2.1", default-features = false } -frost-secp256k1 = { version = "2.1", default-features = false } -frost-secp256k1-evm = { version = "2.1", default-features = false } -frost-secp256k1-tr = { version = "2.1", default-features = false } +frost-core = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", features = ["internals"], default-features = false } +frost-ed25519 = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } +frost-ed448 = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } +frost-p256 = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } +frost-ristretto255 = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } +frost-secp256k1 = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } +frost-secp256k1-evm = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } +frost-secp256k1-tr = { version = "2.1", git = "https://github.com/StackOverflowExcept1on/frost", branch = "frost-secp256k1-evm-crates-io-no-std", default-features = false } hkdf = { version = "0.12", default-features = false } rand = { version = "0.8", default-features = false } rand_core = { version = "0.6", default-features = false } sha2 = { version = "0.10", default-features = false } sha3 = { version = "0.10", default-features = false } -thiserror-nostd-notrait = { version = "1.0", default-features = false } -thiserror = { version = "1.0", default-features = false } # TODO: https://github.com/ZcashFoundation/frost/issues/768 +thiserror = { version = "2.0", default-features = false } roast-core = { path = "roast-core", default-features = false } roast-ed25519 = { path = "roast-ed25519", default-features = false } diff --git a/roast-core/Cargo.toml b/roast-core/Cargo.toml index cdab210..e4da64e 100644 --- a/roast-core/Cargo.toml +++ b/roast-core/Cargo.toml @@ -20,14 +20,11 @@ frost-core.workspace = true hkdf.workspace = true rand = { workspace = true, optional = true } rand_core.workspace = true -thiserror-nostd-notrait.workspace = true -thiserror = { workspace = true, optional = true } +thiserror.workspace = true [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["dep:thiserror"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-core/src/dkg.rs b/roast-core/src/dkg.rs index ded8bb5..1a68a41 100644 --- a/roast-core/src/dkg.rs +++ b/roast-core/src/dkg.rs @@ -54,37 +54,38 @@ fn try_apply_keystream(key: [u8; 16], iv: [u8; 16], buffer: &mut [u8]) -> Option .ok() } +type Round2PackageSerialization = + <<::Group as Group>::Field as Field>::Serialization; + fn encrypt_round2_package( round2_package: round2::Package, receiver_temp_public_key: &VerifyingKey, sender_temp_secret_key: &SigningKey, -) -> Option> { +) -> Option> { let shared_secret_bytes = diffie_hellman(sender_temp_secret_key, receiver_temp_public_key)?; let (key, iv) = hkdf::(shared_secret_bytes)?; let signing_share = round2_package.signing_share().to_scalar(); - let singing_share_bytes = <::Field as Field>::serialize(&signing_share); + let mut singing_share_bytes = <::Field as Field>::serialize(&signing_share); - let mut buffer = singing_share_bytes.as_ref().to_vec(); - try_apply_keystream(key, iv, &mut buffer)?; + try_apply_keystream(key, iv, singing_share_bytes.as_mut())?; - Some(buffer) + Some(singing_share_bytes) } fn decrypt_round2_package( - round2_package_encrypted: Vec, + mut round2_package_encrypted: Round2PackageSerialization, sender_temp_public_key: &VerifyingKey, receiver_temp_secret_key: &SigningKey, ) -> Option> { let shared_secret_bytes = diffie_hellman(receiver_temp_secret_key, sender_temp_public_key)?; let (key, iv) = hkdf::(shared_secret_bytes)?; - let mut buffer = round2_package_encrypted; - try_apply_keystream(key, iv, &mut buffer)?; + try_apply_keystream(key, iv, round2_package_encrypted.as_mut())?; - let buffer_serialized = buffer.try_into().ok()?; - let signing_share = - SigningShare::new(<::Field>::deserialize(&buffer_serialized).ok()?); + let signing_share = SigningShare::new( + <::Field>::deserialize(&round2_package_encrypted).ok()?, + ); Some(round2::Package::new(signing_share)) } @@ -112,7 +113,8 @@ pub struct Dealer { participants: Vec>, participants_set: BTreeSet>, round1_packages: BTreeMap, Round1Package>, - round2_packages_encrypted: BTreeMap, BTreeMap, Vec>>, + round2_packages_encrypted: + BTreeMap, BTreeMap, Round2PackageSerialization>>, round2_participants_set: BTreeSet>, round2_culprits_set: BTreeSet>, phantom: PhantomData, @@ -169,7 +171,7 @@ impl Dealer { pub fn round2_packages_encrypted( &self, receiver_identifier: Identifier, - ) -> Option<&BTreeMap, Vec>> { + ) -> Option<&BTreeMap, Round2PackageSerialization>> { self.round2_packages_encrypted.get(&receiver_identifier) } @@ -220,7 +222,7 @@ impl Dealer { pub fn receive_round2_packages_encrypted( &mut self, identifier: Identifier, - round2_packages_encrypted: BTreeMap, Vec>, + round2_packages_encrypted: BTreeMap, Round2PackageSerialization>, ) -> Result> { if !self.participants_set.contains(&identifier) { return Err(DkgDealerError::UnknownParticipant); @@ -230,25 +232,11 @@ impl Dealer { return Err(DkgDealerError::Frost(FrostError::IncorrectNumberOfPackages)); } - let zero = <::Field>::zero(); - let serialization = <::Field>::serialize(&zero); - let expected_len = serialization.as_ref().len(); - - // check that `round2_packages_encrypted` keys contain all identifiers except - // sender identifier if self .participants .iter() .filter(|id| identifier.ne(id)) - .any(|id| { - // value must be `Some(_)` and must also have length of `expected_len` - round2_packages_encrypted - .get(id) - .filter(|round2_package_encrypted| { - round2_package_encrypted.len() == expected_len - }) - .is_none() - }) + .any(|id| !round2_packages_encrypted.contains_key(id)) { return Err(DkgDealerError::Frost(FrostError::IncorrectPackage)); } @@ -461,7 +449,8 @@ impl Participant { pub fn receive_round1_packages( &mut self, mut round1_packages: BTreeMap, Round1Package>, - ) -> Result, Vec>, DkgParticipantError> { + ) -> Result, Round2PackageSerialization>, DkgParticipantError> + { let round1_secret_package = self .round1_secret_package .take() @@ -501,7 +490,7 @@ impl Participant { /// Receives `round2_packages_encrypted` from the dealer. pub fn receive_round2_packages_encrypted( &mut self, - round2_packages_encrypted: BTreeMap, Vec>, + round2_packages_encrypted: BTreeMap, Round2PackageSerialization>, ) -> Result<(KeyPackage, PublicKeyPackage), DkgParticipantError> { let round2_secret_package = self .round2_secret_package diff --git a/roast-core/src/error.rs b/roast-core/src/error.rs index a2cc877..f859ae4 100644 --- a/roast-core/src/error.rs +++ b/roast-core/src/error.rs @@ -1,10 +1,7 @@ //! Error types. use frost_core::{Ciphersuite, Error as FrostErrorType}; -#[cfg(feature = "std")] use thiserror::Error; -#[cfg(not(feature = "std"))] -use thiserror_nostd_notrait::Error; /// Represents all possible errors that can occur in FROST protocol. pub type FrostError = FrostErrorType; @@ -48,19 +45,6 @@ pub enum DkgParticipantError { InvalidSecretShares, } -/// Represents all possible errors that can occur in Distributed Key Generation -/// protocol. -#[cfg(any(test, feature = "test-impl"))] -#[derive(Error, Debug, Copy, Clone, Eq, PartialEq)] -pub enum DkgError { - /// Error in Distributed Key Generation protocol on dealer side. - #[error("DKG dealer error: {0}")] - DkgDealer(#[from] DkgDealerError), - /// Error in Distributed Key Generation protocol on participant side. - #[error("DKG participant error: {0}")] - DkgParticipant(#[from] DkgParticipantError), -} - /// Represents all possible errors for which signer can be marked as malicious. #[derive(Error, Debug, Copy, Clone, Eq, PartialEq)] pub enum MaliciousSignerError { diff --git a/roast-core/src/lib.rs b/roast-core/src/lib.rs index 529ea53..7288bb6 100644 --- a/roast-core/src/lib.rs +++ b/roast-core/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-core/src/tests.rs b/roast-core/src/tests.rs index 6363dbe..fc22cfa 100644 --- a/roast-core/src/tests.rs +++ b/roast-core/src/tests.rs @@ -2,11 +2,12 @@ use crate::{ dkg::{Dealer, Participant}, - error::{DkgError, DkgParticipantError, RoastError}, + error::{DkgParticipantError, RoastError}, Coordinator, SessionStatus, Signer, }; use aes::cipher::crypto_common::BlockSizeUser; -use alloc::collections::BTreeMap; +use alloc::{boxed::Box, collections::BTreeMap}; +use core::error::Error; use digest::Digest; use frost_core::{ keys::{self, IdentifierList, KeyPackage}, @@ -25,7 +26,7 @@ pub fn test_dkg_basic< min_signers: u16, max_signers: u16, rng: &mut RNG, -) -> Result<(), DkgError> { +) -> Result<(), Box> { let mut identifiers = vec![]; let mut participants = vec![]; diff --git a/roast-ed25519/Cargo.toml b/roast-ed25519/Cargo.toml index af0ac6b..8dfcbf3 100644 --- a/roast-ed25519/Cargo.toml +++ b/roast-ed25519/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-ed25519/src/lib.rs b/roast-ed25519/src/lib.rs index f1c2e96..6403d59 100644 --- a/roast-ed25519/src/lib.rs +++ b/roast-ed25519/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-ed25519/tests/integration_tests.rs b/roast-ed25519/tests/integration_tests.rs index f516819..b8c6cdb 100644 --- a/roast-ed25519/tests/integration_tests.rs +++ b/roast-ed25519/tests/integration_tests.rs @@ -1,10 +1,10 @@ -use roast_core::{error::DkgError, tests}; +use roast_core::tests; use roast_ed25519::{error::RoastError, frost::rand_core::OsRng}; #[test] -fn test_dkg_basic() -> Result<(), DkgError> { +fn test_dkg_basic() -> Result<(), Box> { let mut rng = OsRng; - tests::test_dkg_basic::<_, sha2::Sha512, _>(2, 3, &mut rng)?; + tests::test_dkg_basic::(2, 3, &mut rng)?; Ok(()) } diff --git a/roast-ed448/Cargo.toml b/roast-ed448/Cargo.toml index 4a18477..2f8e327 100644 --- a/roast-ed448/Cargo.toml +++ b/roast-ed448/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-ed448/src/lib.rs b/roast-ed448/src/lib.rs index a0ce1bd..0337ebb 100644 --- a/roast-ed448/src/lib.rs +++ b/roast-ed448/src/lib.rs @@ -1,4 +1,4 @@ -// TODO: #![cfg_attr(not(feature = "std"), no_std)] (https://github.com/ZcashFoundation/frost/issues/769) +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-p256/Cargo.toml b/roast-p256/Cargo.toml index 883b0b1..76d7efd 100644 --- a/roast-p256/Cargo.toml +++ b/roast-p256/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-p256/src/lib.rs b/roast-p256/src/lib.rs index f0e2796..91e03a0 100644 --- a/roast-p256/src/lib.rs +++ b/roast-p256/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-p256/tests/integration_tests.rs b/roast-p256/tests/integration_tests.rs index 3b53c75..ae8a914 100644 --- a/roast-p256/tests/integration_tests.rs +++ b/roast-p256/tests/integration_tests.rs @@ -1,10 +1,10 @@ -use roast_core::{error::DkgError, tests}; +use roast_core::tests; use roast_p256::{error::RoastError, frost::rand_core::OsRng}; #[test] -fn test_dkg_basic() -> Result<(), DkgError> { +fn test_dkg_basic() -> Result<(), Box> { let mut rng = OsRng; - tests::test_dkg_basic::<_, sha2::Sha256, _>(2, 3, &mut rng)?; + tests::test_dkg_basic::(2, 3, &mut rng)?; Ok(()) } diff --git a/roast-ristretto255/Cargo.toml b/roast-ristretto255/Cargo.toml index 875ed48..c4048f2 100644 --- a/roast-ristretto255/Cargo.toml +++ b/roast-ristretto255/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-ristretto255/src/lib.rs b/roast-ristretto255/src/lib.rs index b26bdbe..1267b11 100644 --- a/roast-ristretto255/src/lib.rs +++ b/roast-ristretto255/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-ristretto255/tests/integration_tests.rs b/roast-ristretto255/tests/integration_tests.rs index 7bf4372..01789da 100644 --- a/roast-ristretto255/tests/integration_tests.rs +++ b/roast-ristretto255/tests/integration_tests.rs @@ -1,10 +1,12 @@ -use roast_core::{error::DkgError, tests}; +use roast_core::tests; use roast_ristretto255::{error::RoastError, frost::rand_core::OsRng}; #[test] -fn test_dkg_basic() -> Result<(), DkgError> { +fn test_dkg_basic() -> Result<(), Box> { let mut rng = OsRng; - tests::test_dkg_basic::<_, sha2::Sha512, _>(2, 3, &mut rng)?; + tests::test_dkg_basic::( + 2, 3, &mut rng, + )?; Ok(()) } diff --git a/roast-secp256k1-evm/Cargo.toml b/roast-secp256k1-evm/Cargo.toml index a65461c..afe64f1 100644 --- a/roast-secp256k1-evm/Cargo.toml +++ b/roast-secp256k1-evm/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-secp256k1-evm/src/lib.rs b/roast-secp256k1-evm/src/lib.rs index c35cea1..5c6d134 100644 --- a/roast-secp256k1-evm/src/lib.rs +++ b/roast-secp256k1-evm/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-secp256k1-evm/tests/integration_tests.rs b/roast-secp256k1-evm/tests/integration_tests.rs index 02a0def..1768f94 100644 --- a/roast-secp256k1-evm/tests/integration_tests.rs +++ b/roast-secp256k1-evm/tests/integration_tests.rs @@ -1,10 +1,12 @@ -use roast_core::{error::DkgError, tests}; +use roast_core::tests; use roast_secp256k1_evm::{error::RoastError, frost::rand_core::OsRng}; #[test] -fn test_dkg_basic() -> Result<(), DkgError> { +fn test_dkg_basic() -> Result<(), Box> { let mut rng = OsRng; - tests::test_dkg_basic::<_, sha3::Keccak256, _>(2, 3, &mut rng)?; + tests::test_dkg_basic::( + 2, 3, &mut rng, + )?; Ok(()) } diff --git a/roast-secp256k1-tr/Cargo.toml b/roast-secp256k1-tr/Cargo.toml index 030b4d7..5e54c7c 100644 --- a/roast-secp256k1-tr/Cargo.toml +++ b/roast-secp256k1-tr/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-secp256k1-tr/src/lib.rs b/roast-secp256k1-tr/src/lib.rs index 2d8a590..df33c97 100644 --- a/roast-secp256k1-tr/src/lib.rs +++ b/roast-secp256k1-tr/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-secp256k1-tr/tests/integration_tests.rs b/roast-secp256k1-tr/tests/integration_tests.rs index 0cbcf21..2686b03 100644 --- a/roast-secp256k1-tr/tests/integration_tests.rs +++ b/roast-secp256k1-tr/tests/integration_tests.rs @@ -1,10 +1,12 @@ -use roast_core::{error::DkgError, tests}; +use roast_core::tests; use roast_secp256k1_tr::{error::RoastError, frost::rand_core::OsRng}; #[test] -fn test_dkg_basic() -> Result<(), DkgError> { +fn test_dkg_basic() -> Result<(), Box> { let mut rng = OsRng; - tests::test_dkg_basic::<_, sha2::Sha256, _>(2, 3, &mut rng)?; + tests::test_dkg_basic::( + 2, 3, &mut rng, + )?; Ok(()) } diff --git a/roast-secp256k1/Cargo.toml b/roast-secp256k1/Cargo.toml index ef0488c..163dcd5 100644 --- a/roast-secp256k1/Cargo.toml +++ b/roast-secp256k1/Cargo.toml @@ -22,10 +22,8 @@ roast-core = { workspace = true, features = ["test-impl"] } rand_core = { workspace = true, features = ["getrandom"] } [features] -default = ["serialization", "cheater-detection", "std"] +default = ["serialization", "cheater-detection"] #! ## Features -## Enable standard library support. -std = ["roast-core/std"] ## Enable `serde` support for types that need to be communicated. You ## can use `serde` to serialize structs with any encoder that supports ## `serde` (e.g. JSON with `serde_json`). diff --git a/roast-secp256k1/src/lib.rs b/roast-secp256k1/src/lib.rs index 38abdee..37b07f8 100644 --- a/roast-secp256k1/src/lib.rs +++ b/roast-secp256k1/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(not(feature = "std"), no_std)] +#![no_std] #![deny(missing_docs)] #![doc = include_str!("../README.md")] #![doc = document_features::document_features!()] diff --git a/roast-secp256k1/tests/integration_tests.rs b/roast-secp256k1/tests/integration_tests.rs index 8bc97dd..f923d6b 100644 --- a/roast-secp256k1/tests/integration_tests.rs +++ b/roast-secp256k1/tests/integration_tests.rs @@ -1,10 +1,10 @@ -use roast_core::{error::DkgError, tests}; +use roast_core::tests; use roast_secp256k1::{error::RoastError, frost::rand_core::OsRng}; #[test] -fn test_dkg_basic() -> Result<(), DkgError> { +fn test_dkg_basic() -> Result<(), Box> { let mut rng = OsRng; - tests::test_dkg_basic::<_, sha2::Sha256, _>(2, 3, &mut rng)?; + tests::test_dkg_basic::(2, 3, &mut rng)?; Ok(()) }