/// Executes a complete resharing DKG.
///
/// Panics if the DKG fails at any stage.
Executes a complete resharing DKG.
Panics if the DKG fails at any stage.
Executes a complete resharing DKG . Panics if the DKG fails at any stage .
pub fn by_resharing_or_panic(
        mut rng: &mut ChaCha20Rng,
        state: StateWithThresholdKeys,
        num_new_receivers: usize,
        new_threshold: usize,
    ) -> Self {
        let original_public_coefficients = CspPublicCoefficients::from(&state.transcript);
        let state = InitialState::resharing(&mut rng, num_new_receivers, state);
        let state = StateWithEphemeralKeys::new(state);
        state
            .verify_ephemeral()
            .expect("Ephemeral keys failed to verify");
        let state = StateWithDealings::resharing(
            state,
            NumberOfNodes::from(new_threshold as NodeIndex),
            original_public_coefficients.clone(),
        );
        state
            .verify_resharing_dealing(original_public_coefficients.clone())
            .expect("Resharing dealing failed to verify");
        let state = StateWithResponses::new(state);
        state
            .verify_responses()
            .expect("Responses failed to verify");
        let state = StateWithTranscript::resharing(state, original_public_coefficients);
        StateWithThresholdKeys::new(state)
    }
pub fn by_resharing_or_panic ( mut rng : & mut ChaCha20Rng , state : StateWithThresholdKeys , num_new_receivers : usize , new_threshold : usize , ) -> Self { let original_public_coefficients = CspPublicCoefficients :: from ( & state . transcript ) ; let state = InitialState :: resharing ( & mut rng , num_new_receivers , state ) ; let state = StateWithEphemeralKeys :: new ( state ) ; state . verify_ephemeral ( ) . expect ( " " ) ; let state = StateWithDealings :: resharing ( state , NumberOfNodes :: from ( new_threshold as NodeIndex ) , original_public_coefficients . clone ( ) , ) ; state . verify_resharing_dealing ( original_public_coefficients . clone ( ) ) . expect ( " " ) ; let state = StateWithResponses :: new ( state ) ; state . verify_responses ( ) . expect ( " " ) ; let state = StateWithTranscript :: resharing ( state , original_public_coefficients ) ; StateWithThresholdKeys :: new ( state ) }
Executes a complete resharing DKG.
Executes a complete resharing DKG .
rng
&mut ChaCha20Rng
state
StateWithThresholdKeys
num_new_receivers
usize
new_threshold
usize