Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ZcashFoundation/frost into …
Browse files Browse the repository at this point in the history
…invalid-secret-share-culprit
  • Loading branch information
conradoplg committed Oct 8, 2024
2 parents c65bf62 + 16d527c commit e692d98
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:

steps:
- uses: actions/[email protected]
# 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
Expand Down
1 change: 1 addition & 0 deletions frost-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<C>` in `Box<dyn std::error::Error>`.
* 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<C>::culprit()`).
Expand Down
6 changes: 4 additions & 2 deletions frost-core/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ where
.collect::<Result<_, Error<C>>>()
}

/// Returns VerifiableSecretSharingCommitment from a iterator of serialized
/// CoefficientCommitments (e.g. a Vec<Vec<u8>>).
/// Returns VerifiableSecretSharingCommitment from an iterator of serialized
/// CoefficientCommitments (e.g. a [`Vec<Vec<u8>>`]).
pub fn deserialize<I, V>(serialized_coefficient_commitments: I) -> Result<Self, Error<C>>
where
I: IntoIterator<Item = V>,
Expand Down Expand Up @@ -771,6 +771,8 @@ where
}
}

/// Validates the number of signers.
#[cfg_attr(feature = "internals", visibility::make(pub))]
fn validate_num_of_signers<C: Ciphersuite>(
min_signers: u16,
max_signers: u16,
Expand Down
5 changes: 3 additions & 2 deletions frost-core/src/keys/dkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<C: Ciphersuite> {
/// The identifier of the participant holding the secret.
pub(crate) identifier: Identifier<C>,
/// 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<Scalar<C>>,
/// The public commitment for the participant (C_i)
pub(crate) commitment: VerifiableSecretSharingCommitment<C>,
Expand Down Expand Up @@ -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<C: Ciphersuite> {
/// The identifier of the participant holding the secret.
pub(crate) identifier: Identifier<C>,
Expand Down

0 comments on commit e692d98

Please sign in to comment.