/// Generates new keys for threshold signatories and a signature using the new
/// keys.
///
/// This is only used for testing (cf. CRP-622 and
/// `ic-crypto-internal-csp::imported_utilities::
/// combined_threshold_signature_and_public_key`).
///
/// # Arguments
/// * `seed` is a random input.  It must be treated as a secret.
/// * `message` is the bytes to be signed.
/// * `group_size` is the number of signatories.
///
/// # Panics
/// * If any one of key generation, signing, signature combination, or
/// public key combination fails.
Generates new keys for threshold signatories and a signature using the new
keys.

This is only used for testing (cf.
Generates new keys for threshold signatories and a signature using the new keys . This is only used for testing ( cf .
pub fn combined_signature_and_public_key(
    seed: Randomness,
    group_size: usize,
    threshold: NumberOfNodes,
    message: &[u8],
) -> (CombinedSignatureBytes, PublicKeyBytes) {
    let (public_coefficients, secret_keys) =
        keygen(seed, threshold, &vec![true; group_size]).expect("Failed to deal");
    let signatures: Vec<Option<IndividualSignatureBytes>> = secret_keys
        .iter()
        .map(|secret_key| {
            Some(
                sign_message(message, &secret_key.expect("Keygen failed")).expect("Failed to sign"),
            )
        })
        .collect();
    let signature =
        combine_signatures(signatures.as_slice(), threshold).expect("Failed to combine signatures");
    let public_key =
        combined_public_key(&public_coefficients).expect("Failed to get combined public key");
    (signature, public_key)
}
pub fn combined_signature_and_public_key ( seed : Randomness , group_size : usize , threshold : NumberOfNodes , message : & [ u8 ] , ) -> ( CombinedSignatureBytes , PublicKeyBytes ) { let ( public_coefficients , secret_keys ) = keygen ( seed , threshold , & vec ! [ true group_size ] ) . expect ( " " ) ; let signatures : Vec < Option < IndividualSignatureBytes > > = secret_keys . iter ( ) . map ( | secret_key | { Some ( sign_message ( message , & secret_key . expect ( " " ) ) . expect ( " " ) , ) } ) . collect ( ) ; let signature = combine_signatures ( signatures . as_slice ( ) , threshold ) . expect ( " " ) ; let public_key = combined_public_key ( & public_coefficients ) . expect ( " " ) ; ( signature , public_key ) }
Generates new keys for threshold signatories and a signature using the new
keys.
Generates new keys for threshold signatories and a signature using the new keys .
seed
Randomness
group_size
usize
threshold
NumberOfNodes
message
&[u8]
panics
If any one of key generation, signing, signature combination, or
public key combination fails.
If any one of key generation signing signature combination or public key combination fails .