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 diff --git a/frost-core/CHANGELOG.md b/frost-core/CHANGELOG.md index a8f026ae..7720c1a8 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`. * It is now possible to identify the culprit in `frost_core::keys::dkg::part3()` if an invalid secret share was sent by one of the participants (by calling frost_core::Error::culprit()`). diff --git a/frost-core/src/keys.rs b/frost-core/src/keys.rs index f95cdfd6..9834665d 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, @@ -771,6 +771,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, diff --git a/frost-core/src/keys/dkg.rs b/frost-core/src/keys/dkg.rs index f3859482..60b33cdc 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,