From d31257f9321a264bbd112568b1215d2538a1e85a Mon Sep 17 00:00:00 2001 From: Conrado Gouvea Date: Wed, 2 Oct 2024 11:26:38 -0300 Subject: [PATCH 1/4] ci: pin nightly toolchain when using minimal-versions (#742) --- .github/workflows/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97b3f2de..1ac32783 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,8 +30,13 @@ jobs: steps: - uses: actions/checkout@v4.1.7 - # Re-resolve Cargo.lock with minimal versions - - uses: dtolnay/rust-toolchain@nightly + # Re-resolve Cargo.lock with minimal versions. + # This only works with nightly. We pin to a specific version because + # newer versions use lock file version 4, but the MSRV cargo does not + # support that. + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2024-09-20 - run: cargo update -Z minimal-versions # Now check that `cargo build` works with respect to the oldest possible # deps and the stated MSRV From 30977f6b53e1c5887f5959cfdbc31a46c95839f8 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Wed, 2 Oct 2024 19:12:53 +0400 Subject: [PATCH 2/4] Add `internal` feature for `validate_num_of_signers` (#740) Co-authored-by: Conrado Gouvea --- frost-core/src/keys.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frost-core/src/keys.rs b/frost-core/src/keys.rs index 5a884e42..9112e108 100644 --- a/frost-core/src/keys.rs +++ b/frost-core/src/keys.rs @@ -760,6 +760,8 @@ where } } +/// Validates the number of signers. +#[cfg_attr(feature = "internals", visibility::make(pub))] fn validate_num_of_signers( min_signers: u16, max_signers: u16, From 0da193817ab72d0e3998b675d7318fb25749f32c Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:57:24 +0300 Subject: [PATCH 3/4] chore(docs): fix rustdoc warning (#745) --- frost-core/src/keys.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frost-core/src/keys.rs b/frost-core/src/keys.rs index 9112e108..916e4672 100644 --- a/frost-core/src/keys.rs +++ b/frost-core/src/keys.rs @@ -327,8 +327,8 @@ where .collect::>>() } - /// Returns VerifiableSecretSharingCommitment from a iterator of serialized - /// CoefficientCommitments (e.g. a Vec>). + /// Returns VerifiableSecretSharingCommitment from an iterator of serialized + /// CoefficientCommitments (e.g. a [`Vec>`]). pub fn deserialize(serialized_coefficient_commitments: I) -> Result> where I: IntoIterator, From 16d527c830bdca11cf5c1f45a7cfc8db1df9eaf7 Mon Sep 17 00:00:00 2001 From: StackOverflowExcept1on <109800286+StackOverflowExcept1on@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:23:37 +0300 Subject: [PATCH 4/4] Add missing `derive(Getters)` for `dkg::{round1, round2}` (#741) * Add missing `derive(Getters)` for `dkg::{round1, round2}` * update CHANGELOG --------- Co-authored-by: Conrado Gouvea --- frost-core/CHANGELOG.md | 1 + frost-core/src/keys/dkg.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frost-core/CHANGELOG.md b/frost-core/CHANGELOG.md index 915ef475..43f03eb0 100644 --- a/frost-core/CHANGELOG.md +++ b/frost-core/CHANGELOG.md @@ -10,6 +10,7 @@ Entries are listed in reverse chronological order. but it's likely to not require any code changes since most ciphersuite implementations are probably just empty structs. The bound makes it possible to use `frost_core::Error` in `Box`. +* Added getters to `round1::SecretPackage` and `round2::SecretPackage`. ## 2.0.0-rc.0 diff --git a/frost-core/src/keys/dkg.rs b/frost-core/src/keys/dkg.rs index aa3a56ae..6eece003 100644 --- a/frost-core/src/keys/dkg.rs +++ b/frost-core/src/keys/dkg.rs @@ -116,12 +116,13 @@ pub mod round1 { /// # Security /// /// This package MUST NOT be sent to other participants! - #[derive(Clone, PartialEq, Eq)] + #[derive(Clone, PartialEq, Eq, Getters)] pub struct SecretPackage { /// The identifier of the participant holding the secret. pub(crate) identifier: Identifier, /// Coefficients of the temporary secret polynomial for the participant. /// These are (a_{i0}, ..., a_{i(t−1)})) which define the polynomial f_i(x) + #[getter(skip)] pub(crate) coefficients: Vec>, /// The public commitment for the participant (C_i) pub(crate) commitment: VerifiableSecretSharingCommitment, @@ -233,7 +234,7 @@ pub mod round2 { /// # Security /// /// This package MUST NOT be sent to other participants! - #[derive(Clone, PartialEq, Eq)] + #[derive(Clone, PartialEq, Eq, Getters)] pub struct SecretPackage { /// The identifier of the participant holding the secret. pub(crate) identifier: Identifier,