pub fn combine_signatures(
    signatures: &[Option<IndividualSignatureBytes>],
    threshold: NumberOfNodes,
) -> CryptoResult<CombinedSignatureBytes> {
    let signatures: CryptoResult<Vec<Option<IndividualSignature>>> = signatures
        .iter()
        .map(|option| {
            option
                .map(|signature: IndividualSignatureBytes| (&signature).try_into())
                .transpose()
        })
        .collect();
    Ok(CombinedSignatureBytes::from(&crypto::combine_signatures(
        &signatures?,
        threshold,
    )?))
}
/// Combines individual signatures.
///
/// Note: Individual signatures SHOULD be checked for validity before being
/// combined.
///
/// # Arguments
/// * `signatures` is an array that contains the signature of the `i`th
///   signatory in `signatures[i]`.  Missing signatures are represented by
///   `signatures[i]=None`.  It is important that the signatures have the same
///   indices as the corresponding signatories had during key generation.
/// * `threshold` is the minimum number of signatures needed.
/// # Panics
/// This method is not expected to panic.
/// # Errors
/// * If `signatures` cannot be parsed, this will return an error.  Given that
///   the caller SHOULD verify individual signatures before combining them this
///   SHOULD never occur.
/// * If there are fewer than `threshold` signatures, this will return an error.
Combines individual signatures.
Note: Individual signatures SHOULD be checked for validity before being
combined.
Combines individual signatures . Note : Individual signatures SHOULD be checked for validity before being combined .
pub fn combine_signatures(
    signatures: &[Option<IndividualSignatureBytes>],
    threshold: NumberOfNodes,
) -> CryptoResult<CombinedSignatureBytes> {
    let signatures: CryptoResult<Vec<Option<IndividualSignature>>> = signatures
        .iter()
        .map(|option| {
            option
                .map(|signature: IndividualSignatureBytes| (&signature).try_into())
                .transpose()
        })
        .collect();
    Ok(CombinedSignatureBytes::from(&crypto::combine_signatures(
        &signatures?,
        threshold,
    )?))
}
pub fn combine_signatures ( signatures : & [ Option < IndividualSignatureBytes > ] , threshold : NumberOfNodes , ) -> CryptoResult < CombinedSignatureBytes > { let signatures : CryptoResult < Vec < Option < IndividualSignature > > > = signatures . iter ( ) . map ( | option | { option . map ( | signature : IndividualSignatureBytes | ( & signature ) . try_into ( ) ) . transpose ( ) } ) . collect ( ) ; Ok ( CombinedSignatureBytes :: from ( & crypto :: combine_signatures ( & signatures ? , threshold , ) ? ) ) }
Combines individual signatures.
Combines individual signatures .
signatures
&[Option<IndividualSignatureBytes>]
threshold
NumberOfNodes
signatures
&[Option<IndividualSignatureBytes>]
threshold
NumberOfNodes
panics
This method is not expected to panic.
This method is not expected to panic .
errors
If `signatures` cannot be parsed, this will return an error.  Given that
the caller SHOULD verify individual signatures before combining them this
SHOULD never occur.
If there are fewer than `threshold` signatures, this will return an error.
If ` signatures ` cannot be parsed this will return an error . Given that the caller SHOULD verify individual signatures before combining them this SHOULD never occur . If there are fewer than ` threshold ` signatures this will return an error .