/// For each resharing dealer, generate keys.
///
/// # Arguments
/// * `rng` is the entropy source for key generation.
/// * `original_receiver_shares` are the pre-existing secret threshold keys
///   of the resharing dealers.
/// * `new_threshold` is the minimum number of signatures that will be
///   needed to create a valid threshold signature in the new threshold
///   system.
/// * `new_eligibility` indicates which of the new receivers should receive
///   keys.
For each resharing dealer, generate keys.
For each resharing dealer generate keys .
pub fn multiple_keygen(
        rng: &mut ChaChaRng,
        original_receiver_shares: &[Option<SecretKey>],
        new_threshold: NumberOfNodes,
        new_eligibility: &[bool],
    ) -> Vec<Option<ToyDealing>> {
        original_receiver_shares
            .iter()
            .map(|key_maybe| {
                key_maybe.map(|secret_key| {
                    crypto::keygen_with_secret(
                        Randomness::from(rng.gen::<[u8; 32]>()),
                        new_threshold,
                        new_eligibility,
                        &secret_key,
                    )
                    .expect("Reshare keygen failed")
                })
            })
            .collect()
    }
pub fn multiple_keygen ( rng : & mut ChaChaRng , original_receiver_shares : & [ Option < SecretKey > ] , new_threshold : NumberOfNodes , new_eligibility : & [ bool ] , ) -> Vec < Option < ToyDealing > > { original_receiver_shares . iter ( ) . map ( | key_maybe | { key_maybe . map ( | secret_key | { crypto :: keygen_with_secret ( Randomness :: from ( rng . gen :: < [ u8 ; 32 ] > ( ) ) , new_threshold , new_eligibility , & secret_key , ) . expect ( " " ) } ) } ) . collect ( ) }
For each resharing dealer, generate keys.
For each resharing dealer generate keys .
rng
&mut ChaChaRng
original_receiver_shares
&[Option<SecretKey>]
new_threshold
NumberOfNodes
new_eligibility
&[bool]