fn generate_threshold_keys(
    num_receivers: usize,
    threshold: NumberOfNodes,
    seed: Randomness,
) -> (
    internal_types::PublicCoefficientsBytes,
    Vec<clib::ThresholdSecretKeyBytes>,
) {
    let receiver_eligibility = vec![true; num_receivers];
    let (public_coefficients, threshold_keys_maybe) =
        clib::threshold_keygen(seed, threshold, &receiver_eligibility[..])
            .expect("Test fail: Threshold keygen failed");
    let threshold_keys = threshold_keys_maybe
        .iter()
        .map(|key_maybe| key_maybe.unwrap())
        .collect::<Vec<_>>();
    let public_coefficients = internal_types::PublicCoefficientsBytes {
        coefficients: public_coefficients
            .coefficients
            .iter()
            .map(|x| internal_types::ThresholdPublicKeyBytes(x.0))
            .collect(),
    };
    (public_coefficients, threshold_keys)
}
/// Generates valid threshold keys and the corresponding public coefficients
Generates valid threshold keys and the corresponding public coefficients
Generates valid threshold keys and the corresponding public coefficients
fn generate_threshold_keys(
    num_receivers: usize,
    threshold: NumberOfNodes,
    seed: Randomness,
) -> (
    internal_types::PublicCoefficientsBytes,
    Vec<clib::ThresholdSecretKeyBytes>,
) {
    let receiver_eligibility = vec![true; num_receivers];
    let (public_coefficients, threshold_keys_maybe) =
        clib::threshold_keygen(seed, threshold, &receiver_eligibility[..])
            .expect("Test fail: Threshold keygen failed");
    let threshold_keys = threshold_keys_maybe
        .iter()
        .map(|key_maybe| key_maybe.unwrap())
        .collect::<Vec<_>>();
    let public_coefficients = internal_types::PublicCoefficientsBytes {
        coefficients: public_coefficients
            .coefficients
            .iter()
            .map(|x| internal_types::ThresholdPublicKeyBytes(x.0))
            .collect(),
    };
    (public_coefficients, threshold_keys)
}
fn generate_threshold_keys ( num_receivers : usize , threshold : NumberOfNodes , seed : Randomness , ) -> ( internal_types :: PublicCoefficientsBytes , Vec < clib :: ThresholdSecretKeyBytes > , ) { let receiver_eligibility = vec ! [ true num_receivers ] ; let ( public_coefficients , threshold_keys_maybe ) = clib :: threshold_keygen ( seed , threshold , & receiver_eligibility [ .. ] ) . expect ( " " ) ; let threshold_keys = threshold_keys_maybe . iter ( ) . map ( | key_maybe | key_maybe . unwrap ( ) ) . collect :: < Vec < _ > > ( ) ; let public_coefficients = internal_types :: PublicCoefficientsBytes { coefficients : public_coefficients . coefficients . iter ( ) . map ( | x | internal_types :: ThresholdPublicKeyBytes ( x . 0 ) ) . collect ( ) , } ; ( public_coefficients , threshold_keys ) }
Generates valid threshold keys and the corresponding public coefficients
Generates valid threshold keys and the corresponding public coefficients
num_receivers
usize
threshold
NumberOfNodes
seed
Randomness
num_receivers
usize
threshold
NumberOfNodes
seed
Randomness